Don't wrap code block lines

How to config to don't wrap code block's line? in the markdown editor.

1 Like

在 Custom stylesheet for Joplin-wide app styles 这个 CSS 文件里加入以下代码:

.CodeMirror-code .cm-jn-code-block {
    white-space: pre !important;

This works but long lines will run off the page in an ugly manner. The problem is there's no wrapper element for code blocks in the Markdown editor compared to the rendered view. Without a wrapper there's nothing to put overflow: auto onto except the line itself, and this means each individual line that's wider than the window will scroll by itself -- and include a scrollbar if you're on Windows. What we need is a wrapper for code blocks in the editor, but I don't know if this is possible with CodeMirror.

1 Like

According to this, Codemirror seems to not support that feature.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.