Skip to content

Commit b4d0755

Browse files
authored
Merge pull request #7744 from nextcloud/backport/7733/stable31
[stable31] fix(code): don't wrap lines in code blocks, only in plaintext documents
2 parents 4fc6d66 + b724ab2 commit b4d0755

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/css/prosemirror.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ div.ProseMirror {
193193
}
194194

195195
pre {
196-
white-space: pre-wrap;
196+
white-space: pre;
197+
overflow-x: auto;
197198
background-color: var(--color-background-dark);
198199
border-radius: var(--border-radius);
199200
padding: 1em 1.3em;
@@ -208,6 +209,12 @@ div.ProseMirror {
208209
font-size: 0.6rem;
209210
}
210211
code {
212+
// We want line wrapping in plaintext documents only
213+
white-space: pre !important;
214+
&.language-plaintext {
215+
white-space: pre-wrap !important;
216+
}
217+
211218
.hljs-comment,
212219
.hljs-quote {
213220
color: #999999;

0 commit comments

Comments
 (0)