Skip to content

Commit

Permalink
🎨 Protyle code block read-only rending
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Sep 26, 2024
1 parent dd8f3f4 commit de2735c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion render/protyle_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,9 @@ func (r *ProtyleRenderer) renderCodeBlockCode(node *ast.Node, entering bool) ast
r.Tag("div", attrs, false)
r.Tag("div", nil, false)
r.Tag("/div", nil, false)
r.Tag("div", [][]string{{"contenteditable", "true"}, {"style", "flex: 1"}, {"spellcheck", "false"}}, false)
attrs = [][]string{{"style", "flex: 1"}, {"spellcheck", "false"}}
r.contenteditable(node, &attrs)
r.Tag("div", attrs, false)
if codeIsEmpty {
if caretInInfo {
r.WriteString(editor.FrontEndCaret)
Expand Down

0 comments on commit de2735c

Please sign in to comment.