Skip to content

Commit 7a4fdeb

Browse files
authored
Merge pull request #154 from RooVetGit/fix_markdown_wrapping
Fixes to markdown wrapping
2 parents 011113d + 5885a03 commit 7a4fdeb

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

webview-ui/src/components/common/MarkdownBlock.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,21 @@ const StyledMarkdown = styled.div`
5454
pre {
5555
background-color: ${CODE_BLOCK_BG_COLOR};
5656
border-radius: 3px;
57-
margin: 13x 0;
58-
padding: 10px 10px;
59-
max-width: calc(100vw - 20px);
60-
overflow-x: auto;
61-
overflow-y: hidden;
57+
margin: 13px 0;
58+
padding: 10px;
59+
max-width: 100%;
60+
white-space: pre-wrap;
61+
word-break: break-word;
62+
overflow-wrap: break-word;
6263
}
6364
6465
pre > code {
66+
white-space: pre-wrap;
67+
word-break: break-word;
68+
overflow-wrap: break-word;
69+
width: 100%;
70+
display: inline-block;
71+
6572
.hljs-deletion {
6673
background-color: var(--vscode-diffEditor-removedTextBackground);
6774
display: inline-block;
@@ -78,7 +85,9 @@ const StyledMarkdown = styled.div`
7885
span.line:empty {
7986
display: none;
8087
}
81-
word-wrap: break-word;
88+
white-space: pre-wrap;
89+
word-break: break-word;
90+
overflow-wrap: break-word;
8291
border-radius: 3px;
8392
background-color: ${CODE_BLOCK_BG_COLOR};
8493
font-size: var(--vscode-editor-font-size, var(--vscode-font-size, 12px));
@@ -116,7 +125,10 @@ const StyledMarkdown = styled.div`
116125
li,
117126
ol,
118127
ul {
119-
line-height: 1.25;
128+
line-height: 1.4;
129+
white-space: pre-wrap;
130+
word-break: break-word;
131+
overflow-wrap: break-word;
120132
}
121133
122134
ol,

0 commit comments

Comments
 (0)