File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/vs/workbench/contrib/positronNotebook/browser Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ function markedHighlight(options: marked.MarkedOptions & {
108108 code ( { text, lang, escaped } : marked . Tokens . Code ) {
109109 const classAttr = lang ? ` class="language-${ escape ( lang ) } "` : '' ;
110110 text = text . replace ( / \n $ / , '' ) ;
111- return `<pre><code${ classAttr } >${ escaped ? text : escape ( text ) } \n</code></pre>` ;
111+ // Note: We intentionally omit the trailing \n that marked-highlight includes.
112+ // The \n is preserved by <pre>'s default white-space:pre behavior
113+ // this causes visible whitespace at the bottom of code blocks in Positron notebooks.
114+ return `<pre><code${ classAttr } >${ escaped ? text : escape ( text ) } </code></pre>` ;
112115 } ,
113116 } ,
114117 } ;
Original file line number Diff line number Diff line change 142142 border-radius : 4px ;
143143 }
144144
145+ /** code block styling */
146+ pre {
147+ background-color : var (--vscode-textCodeBlock-background );
148+ padding : 16px ;
149+ border-radius : 4px ;
150+ }
151+
145152 pre code {
146153 line-height : 1.357em ;
147154 white-space : pre-wrap;
148155 padding : 0 ;
156+ background-color : transparent; /* override inline code style */
149157 }
150158
151159 li p {
You can’t perform that action at this time.
0 commit comments