Skip to content

Commit

Permalink
🐛 Protyle Unable to copy HTML block properly siyuan-note/siyuan#11391
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 16, 2024
1 parent ce4169d commit 5b37ee0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion javascript/lute.min.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion protyle.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,10 @@ func (lute *Lute) genASTByBlockDOM(n *html.Node, tree *parse.Tree) {
node.Type = ast.NodeHTMLBlock
content := util.DomAttrValue(n.FirstChild.NextSibling.FirstChild, "data-content")
content = html.UnescapeHTMLStr(content)
content = html.UnescapeHTMLStr(content) // 这里要反转义两次,因为编辑器会对 HTML 实体进行转义
// 这里要反转义两次,因为编辑器会对 HTML 实体进行转义
// https://github.com/siyuan-note/siyuan/issues/11321
// https://github.com/siyuan-note/siyuan/issues/11391
content = html.UnescapeHTMLStr(content)
node.Tokens = util.StrToBytes(content)
tree.Context.Tip.AppendChild(node)
return
Expand Down

0 comments on commit 5b37ee0

Please sign in to comment.