Skip to content

Commit

Permalink
✨ 支持 kramdown 内联属性列表 #89
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Sep 15, 2020
1 parent 8de7453 commit 50ab6cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 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.

11 changes: 8 additions & 3 deletions vditor_ir_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,14 @@ func (lute *Lute) genASTByVditorIRBlockDOM(n *html.Node, tree *parse.Tree) {
}
}
if "" != nodeID {
node.KramdownIAL = [][]string{{"id", nodeID}}
ial := &ast.Node{Type: ast.NodeKramdownIAL, Tokens: []byte("{: id=\"" + nodeID + "\"}")}
defer tree.Context.Tip.AppendChild(ial)
text := lute.domText(n)
text = strings.ReplaceAll(text, parse.Zwsp, "")
text = strings.TrimSpace(text)
if "" != text {
node.KramdownIAL = [][]string{{"id", nodeID}}
ial := &ast.Node{Type: ast.NodeKramdownIAL, Tokens: []byte("{: id=\"" + nodeID + "\"}")}
defer tree.Context.Tip.AppendChild(ial)
}
}

switch n.DataAtom {
Expand Down

0 comments on commit 50ab6cd

Please sign in to comment.