Skip to content

Commit

Permalink
🎨 Protyle 支持代码块搜索定位和高亮 siyuan-note/siyuan#5520
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jul 26, 2022
1 parent f3fe5bb commit 60b3a3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion render/protyle_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,11 @@ func (r *BlockRenderer) renderCodeBlockCode(node *ast.Node, entering bool) ast.W
r.WriteString(util.FrontEndCaret)
}
} else {
r.Write(html.EscapeHTML(node.Tokens))
tokens := html.EscapeHTML(node.Tokens)
// TODO: 支持代码块搜索定位和高亮 https://github.com/siyuan-note/siyuan/issues/5520
//tokens = bytes.ReplaceAll(tokens, []byte("__@mark__"), []byte("<span data-type=\"search-mark\">"))
//tokens = bytes.ReplaceAll(tokens, []byte("__mark@__"), []byte("</span>"))
r.Write(tokens)
}
r.Tag("/div", nil, false)
return ast.WalkContinue
Expand Down

0 comments on commit 60b3a3c

Please sign in to comment.