mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Supports disabling Markdown ~~ syntax input https://github.com/siyuan-note/siyuan/issues/12641
This commit is contained in:
parent
920794b803
commit
1ab7e16888
18 changed files with 84 additions and 32 deletions
|
|
@ -26,21 +26,23 @@ import (
|
|||
|
||||
// MarkdownSettings 运行时 Markdown 配置。
|
||||
var MarkdownSettings = &Markdown{
|
||||
InlineAsterisk: true,
|
||||
InlineUnderscore: true,
|
||||
InlineSup: true,
|
||||
InlineSub: true,
|
||||
InlineTag: true,
|
||||
InlineMath: true,
|
||||
InlineAsterisk: true,
|
||||
InlineUnderscore: true,
|
||||
InlineSup: true,
|
||||
InlineSub: true,
|
||||
InlineTag: true,
|
||||
InlineMath: true,
|
||||
InlineStrikethrough: true,
|
||||
}
|
||||
|
||||
type Markdown struct {
|
||||
InlineAsterisk bool `json:"inlineAsterisk"` // 是否启用行级 * 语法
|
||||
InlineUnderscore bool `json:"inlineUnderscore"` // 是否启用行级 _ 语法
|
||||
InlineSup bool `json:"inlineSup"` // 是否启用行级上标
|
||||
InlineSub bool `json:"inlineSub"` // 是否启用行级下标
|
||||
InlineTag bool `json:"inlineTag"` // 是否启用行级标签
|
||||
InlineMath bool `json:"inlineMath"` // 是否启用行级公式
|
||||
InlineAsterisk bool `json:"inlineAsterisk"` // 是否启用行级 * 语法
|
||||
InlineUnderscore bool `json:"inlineUnderscore"` // 是否启用行级 _ 语法
|
||||
InlineSup bool `json:"inlineSup"` // 是否启用行级上标
|
||||
InlineSub bool `json:"inlineSub"` // 是否启用行级下标
|
||||
InlineTag bool `json:"inlineTag"` // 是否启用行级标签
|
||||
InlineMath bool `json:"inlineMath"` // 是否启用行级公式
|
||||
InlineStrikethrough bool `json:"inlineStrikethrough"` // 是否启用行级删除线
|
||||
}
|
||||
|
||||
func NewLute() (ret *lute.Lute) {
|
||||
|
|
@ -61,6 +63,7 @@ func NewLute() (ret *lute.Lute) {
|
|||
ret.SetSub(MarkdownSettings.InlineSub)
|
||||
ret.SetTag(MarkdownSettings.InlineTag)
|
||||
ret.SetInlineMath(MarkdownSettings.InlineMath)
|
||||
ret.SetGFMStrikethrough(MarkdownSettings.InlineStrikethrough)
|
||||
ret.SetInlineMathAllowDigitAfterOpenMarker(true)
|
||||
ret.SetGFMStrikethrough1(false)
|
||||
ret.SetFootnotes(false)
|
||||
|
|
@ -96,6 +99,7 @@ func NewStdLute() (ret *lute.Lute) {
|
|||
ret.SetSub(MarkdownSettings.InlineSub)
|
||||
ret.SetTag(MarkdownSettings.InlineTag)
|
||||
ret.SetInlineMath(MarkdownSettings.InlineMath)
|
||||
ret.SetGFMStrikethrough(MarkdownSettings.InlineStrikethrough)
|
||||
ret.SetGFMStrikethrough1(false)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue