Skip to content

Commit 0a4a29a

Browse files
committed
fine tune
1 parent e843113 commit 0a4a29a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

modules/markup/markdown/markdown.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,10 @@ func (r *GlodmarkRender) highlightingRenderer(w util.BufWriter, c highlighting.C
8686
preClasses += " is-loading"
8787
}
8888

89-
err := r.ctx.RenderInternal.FormatWithSafeAttrs(w, `<div class="code-block-container code-overflow-scroll"><pre class="%s">`, preClasses)
90-
if err != nil {
91-
return
92-
}
93-
9489
// include language-x class as part of commonmark spec, "chroma" class is used to highlight the code
9590
// the "display" class is used by "js/markup/math.ts" to render the code element as a block
9691
// the "math.ts" strictly depends on the structure: <pre class="code-block is-loading"><code class="language-math display">...</code></pre>
97-
err = r.ctx.RenderInternal.FormatWithSafeAttrs(w, `<code class="chroma language-%s display">`, languageStr)
92+
err := r.ctx.RenderInternal.FormatWithSafeAttrs(w, `<div class="code-block-container code-overflow-scroll"><pre class="%s"><code class="chroma language-%s display">`, preClasses, languageStr)
9893
if err != nil {
9994
return
10095
}

web_src/css/markup/content.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@
460460
}
461461

462462
.markup .code-block-container.code-overflow-scroll pre > code {
463-
white-space: pre-wrap;
463+
white-space: pre;
464464
overflow-wrap: normal;
465465
}
466466

0 commit comments

Comments
 (0)