mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Supports disabling Markdown syntax input for some inline elements https://github.com/siyuan-note/siyuan/issues/11141
This commit is contained in:
parent
53f5b08038
commit
b9f269ae85
17 changed files with 185 additions and 41 deletions
|
|
@ -24,6 +24,21 @@ import (
|
|||
"github.com/siyuan-note/logging"
|
||||
)
|
||||
|
||||
// MarkdownSettings 运行时 Markdown 配置。
|
||||
var MarkdownSettings = &Markdown{
|
||||
InlineSup: false,
|
||||
InlineSub: false,
|
||||
InlineTag: false,
|
||||
InlineMath: false,
|
||||
}
|
||||
|
||||
type Markdown struct {
|
||||
InlineSup bool `json:"inlineSup"` // 是否启用行级上标
|
||||
InlineSub bool `json:"inlineSub"` // 是否启用行级下标
|
||||
InlineTag bool `json:"inlineTag"` // 是否启用行级标签
|
||||
InlineMath bool `json:"inlineMath"` // 是否启用行级公式
|
||||
}
|
||||
|
||||
func NewLute() (ret *lute.Lute) {
|
||||
ret = lute.New()
|
||||
ret.SetTextMark(true)
|
||||
|
|
@ -36,9 +51,12 @@ func NewLute() (ret *lute.Lute) {
|
|||
ret.SetImgPathAllowSpace(true)
|
||||
ret.SetGitConflict(true)
|
||||
ret.SetMark(true)
|
||||
ret.SetSup(true)
|
||||
ret.SetSub(true)
|
||||
ret.SetSup(MarkdownSettings.InlineSup)
|
||||
ret.SetSub(MarkdownSettings.InlineSub)
|
||||
ret.SetTag(MarkdownSettings.InlineTag)
|
||||
ret.SetInlineMath(MarkdownSettings.InlineMath)
|
||||
ret.SetInlineMathAllowDigitAfterOpenMarker(true)
|
||||
ret.SetGFMStrikethrough1(false)
|
||||
ret.SetFootnotes(false)
|
||||
ret.SetToC(false)
|
||||
ret.SetIndentCodeBlock(false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue