Skip to content

Commit

Permalink
🎨 Protyle Only HTML code wrapped in <div> is supported to be parsed…
Browse files Browse the repository at this point in the history
… into HTML blocks siyuan-note/siyuan#9758
  • Loading branch information
88250 committed Nov 27, 2023
1 parent 00e0106 commit 9af4adc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion javascript/lute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion javascript/lute.min.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions parse/html_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ func HtmlBlockStart(t *Tree, container *ast.Node) int {
}
}

if t.Context.ParseOption.ProtyleWYSIWYG {
// Protyle WYSIWYG 模式下,只有 <div 开头的块级元素才能被解析为 HTML 块
// Only HTML code wrapped in `<div>` is supported to be parsed into HTML blocks https://github.com/siyuan-note/siyuan/issues/9758
if !bytes.HasPrefix(t.Context.currentLine, []byte("<div")) {
return 0
}
}

block := t.Context.addChild(ast.NodeHTMLBlock)
block.HtmlBlockType = htmlType
return 2
Expand Down
Loading

0 comments on commit 9af4adc

Please sign in to comment.