Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Apr 2, 2024
1 parent c4d9060 commit 289479d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/markup/html_codepreview.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func renderCodeBlock(ctx *RenderContext, node *html.Node) (urlPosStart, urlPosSt

func codePreviewPatternProcessor(ctx *RenderContext, node *html.Node) {
for node != nil {
if node.Type != html.TextNode {
node = node.NextSibling
continue
}
urlPosStart, urlPosEnd, h, err := renderCodeBlock(ctx, node)
if err != nil || h == "" {
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions web_src/css/markup/codepreview.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.markup .code-preview-container {
border: 1px solid var(--color-secondary);
border-radius: var(--border-radius);
margin: 0.25em 0;
}

Expand All @@ -13,6 +14,7 @@
width: 100%;
max-height: 100px;
overflow-y: auto;
margin: 0; /* override ".markup table {margin}" */
}

/* override the polluted styles from the content.css: ".markup table ..." */
Expand Down

0 comments on commit 289479d

Please sign in to comment.