mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🎨 行级元素支持嵌套和交叉 https://github.com/siyuan-note/siyuan/issues/2911
This commit is contained in:
parent
f0a6c2be8a
commit
eefede8fff
5 changed files with 19 additions and 7 deletions
|
|
@ -22,9 +22,12 @@ import (
|
|||
|
||||
"github.com/88250/lute"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/editor"
|
||||
"github.com/88250/lute/html"
|
||||
"github.com/88250/lute/lex"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/88250/lute/render"
|
||||
"github.com/88250/lute/util"
|
||||
"github.com/siyuan-note/logging"
|
||||
)
|
||||
|
||||
|
|
@ -325,3 +328,13 @@ func GetDynamicBlockRefText(blockRef *ast.Node) string {
|
|||
}
|
||||
return "ref resolve failed"
|
||||
}
|
||||
|
||||
func IsChartCodeBlockCode(code *ast.Node) bool {
|
||||
if nil == code.Previous || ast.NodeCodeBlockFenceInfoMarker != code.Previous.Type || 1 > len(code.Previous.CodeBlockInfo) {
|
||||
return false
|
||||
}
|
||||
|
||||
language := util.BytesToStr(code.Previous.CodeBlockInfo)
|
||||
language = strings.ReplaceAll(language, editor.Caret, "")
|
||||
return render.NoHighlight(language)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue