mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
♻️ 移除旧版中的行级元素实现代码 https://github.com/siyuan-note/siyuan/issues/6819
This commit is contained in:
parent
fb1c002500
commit
b3599ee150
6 changed files with 4 additions and 24 deletions
|
|
@ -428,8 +428,6 @@ func resolveRefContent0(node *ast.Node, anchors *map[string]string, depth *int,
|
|||
case ast.NodeDocument:
|
||||
buf.WriteString(n.IALAttr("title"))
|
||||
return ast.WalkStop
|
||||
case ast.NodeTagOpenMarker, ast.NodeTagCloseMarker:
|
||||
buf.WriteByte('#')
|
||||
case ast.NodeText, ast.NodeLinkText, ast.NodeLinkTitle, ast.NodeFileAnnotationRefText, ast.NodeFootnotesRef,
|
||||
ast.NodeCodeSpanContent, ast.NodeInlineMathContent, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
|
||||
buf.Write(n.Tokens)
|
||||
|
|
@ -620,11 +618,11 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
|
|||
}
|
||||
assets = append(assets, asset)
|
||||
return
|
||||
case ast.NodeTag, ast.NodeInlineMath, ast.NodeCodeSpan, ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline, ast.NodeTextMark:
|
||||
case ast.NodeInlineMath, ast.NodeCodeSpan, ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline, ast.NodeTextMark:
|
||||
typ := treenode.TypeAbbr(n.Type.String())
|
||||
var text string
|
||||
switch n.Type {
|
||||
case ast.NodeTag, ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline:
|
||||
case ast.NodeEmphasis, ast.NodeStrong, ast.NodeStrikethrough, ast.NodeMark, ast.NodeSup, ast.NodeSub, ast.NodeKbd, ast.NodeUnderline:
|
||||
text = n.Text()
|
||||
case ast.NodeInlineMath:
|
||||
text = n.ChildByType(ast.NodeInlineMathContent).TokensStr()
|
||||
|
|
@ -843,7 +841,7 @@ func tagFromNode(node *ast.Node) (ret string) {
|
|||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
if ast.NodeTag == n.Type || n.IsTextMarkType("tag") {
|
||||
if n.IsTextMarkType("tag") {
|
||||
tagBuilder.WriteString("#")
|
||||
tagBuilder.WriteString(n.Text())
|
||||
tagBuilder.WriteString("# ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue