Skip to content

Commit

Permalink
🐛 Protyle Code blocks are not syntax highlighted when exporting to PD…
Browse files Browse the repository at this point in the history
…F/image/HTML siyuan-note/siyuan#12378
  • Loading branch information
88250 committed Sep 2, 2024
1 parent 2698c39 commit 310b8e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions render/protyle_export_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,10 @@ func (r *ProtyleExportRenderer) renderCodeBlockCode(node *ast.Node, entering boo
r.Tag("/div", nil, false)

attrs = [][]string{{"class", "hljs"}}
r.contenteditable(node, &attrs)
r.spellcheck(&attrs)
r.Tag("div", attrs, false)
r.Tag("div", nil, false)
r.Tag("/div", nil, false)
r.Tag("div", [][]string{{"contenteditable", "false"}, {"style", "flex: 1"}, {"spellcheck", "false"}}, false)
if codeIsEmpty {
if caretInInfo {
r.WriteString(editor.FrontEndCaret)
Expand All @@ -924,6 +925,7 @@ func (r *ProtyleExportRenderer) renderCodeBlockCode(node *ast.Node, entering boo
r.Write(html.EscapeHTML(node.Tokens))
}
r.Tag("/div", nil, false)
r.Tag("/div", nil, false)
return ast.WalkContinue
}

Expand Down

0 comments on commit 310b8e4

Please sign in to comment.