Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-02-13 17:00:04 +08:00
commit ab18a537f6
23 changed files with 66 additions and 9 deletions

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "عدم التشغيل تلقائيًا",
"autoLaunchMode1": "التشغيل التلقائي بعد الإقلاع",
"autoLaunchMode2": "التشغيل التلقائي وتقليل الواجهة الرئيسية بعد الإقلاع",
"editorMarkdownInlineMark": "صيغة العلامة المضمنة في Markdown",
"editorMarkdownInlineMarkTip": "بمجرد التمكين، سيتم دعم إدخال صيغة العلامة المضمنة <code class='fn__code'>==foo==</code>",
"editorMarkdownInlineStrikethrough": "‫صياغة الشطب بخط داخل السطر في Markdown",
"editorMarkdownInlineStrikethroughTip": "‫بعد التمكين, سيتم دعم إدخال <code class='fn__code'>~~foo~~</code> لإضافة شطب بخط داخل السطر‬",
"editorMarkdownInlineSup": "‫صياغة النص المرتفع دخل السطر في Markdown",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "Nicht automatisch starten",
"autoLaunchMode1": "Automatisch nach dem Booten starten",
"autoLaunchMode2": "Automatisch starten und die Hauptoberfläche minimieren nach dem Booten",
"editorMarkdownInlineMark": "Markdown-Inline-Markup-Syntax",
"editorMarkdownInlineMarkTip": "Nach dem Aktivieren wird die Eingabe der Inline-Markup-Syntax <code class='fn__code'>==foo==</code> unterstützt",
"editorMarkdownInlineStrikethrough": "Markdown Inline-Durchstreichsyntax",
"editorMarkdownInlineStrikethroughTip": "Nach der Aktivierung wird die Eingabe der Inline-Durchstreichsyntax <code class='fn__code'>~~foo~~</code> unterstützt",
"editorMarkdownInlineSup": "Markdown Inline-Hochstellungssyntax",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "Do not launch automatically",
"autoLaunchMode1": "Auto launch after booting",
"autoLaunchMode2": "Auto launch and minimize the main interface after booting",
"editorMarkdownInlineMark": "Markdown inline mark syntax",
"editorMarkdownInlineMarkTip": "After enabling, the <code class='fn__code'>==foo==</code> inline mark syntax input will be supported",
"editorMarkdownInlineStrikethrough": "Markdown inline strikethrough syntax",
"editorMarkdownInlineStrikethroughTip": "After enabling, the <code class='fn__code'>~~foo~~</code> inline strikethrough syntax input will be supported",
"editorMarkdownInlineSup": "Markdown inline superscript syntax",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "No iniciar automáticamente",
"autoLaunchMode1": "Inicio automático después del arranque",
"autoLaunchMode2": "Iniciar automáticamente y minimizar la interfaz principal después del arranque",
"editorMarkdownInlineMark": "Sintaxis de marcado en línea de Markdown",
"editorMarkdownInlineMarkTip": "Una vez habilitado, se admitirá la entrada de la sintaxis de marcado en línea <code class='fn__code'>==foo==</code>",
"editorMarkdownInlineStrikethrough": "Sintaxis de tachado en línea de Markdown",
"editorMarkdownInlineStrikethroughTip": "Una vez habilitado, se admitirá la entrada de sintaxis de tachado en línea <code class='fn__code'>~~foo~~</code>",
"editorMarkdownInlineSup": "Sintaxis de superíndice en línea de Markdown",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "Ne pas lancer automatiquement",
"autoLaunchMode1": "Lancement automatique après le démarrage",
"autoLaunchMode2": "Lancement automatique et minimisation de l'interface principale après le démarrage",
"editorMarkdownInlineMark": "Syntaxe de marquage en ligne Markdown",
"editorMarkdownInlineMarkTip": "Une fois activé, la saisie de la syntaxe de marquage en ligne <code class='fn__code'>==foo==</code> sera prise en charge",
"editorMarkdownInlineStrikethrough": "Syntaxe de ligne barrée Markdown",
"editorMarkdownInlineStrikethroughTip": "Une fois activé, la saisie de la syntaxe de ligne barrée <code class='fn__code'>~~foo~~</code> sera prise en charge",
"editorMarkdownInlineSup": "Syntaxe exposant Markdown en ligne",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "אל תצא אוטומטית",
"autoLaunchMode1": "צא אוטומטית לאחר אתחול",
"autoLaunchMode2": "צא אוטומטית ומזער את הממשק העיקרי לאחר אתחול",
"editorMarkdownInlineMark": "תחביר סימון שורת Markdown",
"editorMarkdownInlineMarkTip": "לאחר ההפעלה, ייתמך קלט תחביר סימון שורת <code class='fn__code'>==foo==</code>",
"editorMarkdownInlineStrikethrough": "תחביר קו חוצה בשורת Markdown",
"editorMarkdownInlineStrikethroughTip": "לאחר ההפעלה, ייתמך קלט תחביר קו חוצה בשורת <code class='fn__code'>~~foo~~</code>",
"editorMarkdownInlineSup": "תחביר עליון בתוך Markdown",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "Non avviare automaticamente",
"autoLaunchMode1": "Avvio automatico dopo l'accensione",
"autoLaunchMode2": "Avvio automatico e minimizzazione dell'interfaccia principale dopo l'accensione",
"editorMarkdownInlineMark": "Sintassi di marcatura inline di Markdown",
"editorMarkdownInlineMarkTip": "Dopo l'attivazione, sarà supportato l'inserimento della sintassi di marcatura inline <code class='fn__code'>==foo==</code>",
"editorMarkdownInlineStrikethrough": "Sintassi di barratura in linea di Markdown",
"editorMarkdownInlineStrikethroughTip": "Dopo l'attivazione, sarà supportato l'inserimento della sintassi di barratura in linea <code class='fn__code'>~~foo~~</code>",
"editorMarkdownInlineSup": "Sintassi Markdown per apice in linea",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "自動的に起動しない",
"autoLaunchMode1": "システムの起動後に自動的に起動する",
"autoLaunchMode2": "システムの起動後にインターフェースを最小化して自動的に起動する",
"editorMarkdownInlineMark": "Markdown インラインマークアップ構文",
"editorMarkdownInlineMarkTip": "<code class='fn__code'>==foo==</code> 形式のインラインマークアップ構文を有効にします",
"editorMarkdownInlineStrikethrough": "Markdown 行内取り消し線の構文",
"editorMarkdownInlineStrikethroughTip": "<code class='fn__code'>~~foo~~</code> 形式のインライン取り消し線構文を有効にします",
"editorMarkdownInlineSup": "Markdown インライン上付き文字構文",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "Nie uruchamiaj automatycznie",
"autoLaunchMode1": "Uruchom automatycznie po włączeniu",
"autoLaunchMode2": "Uruchom automatycznie i zminimalizuj główny interfejs po włączeniu",
"editorMarkdownInlineMark": "Składnia oznaczeń w Markdown",
"editorMarkdownInlineMarkTip": "Po włączeniu będzie obsługiwane wprowadzanie składni oznaczeń <code class='fn__code'>==foo==</code>",
"editorMarkdownInlineStrikethrough": "Markdown składnia przekreślenia",
"editorMarkdownInlineStrikethroughTip": "Po włączeniu będzie obsługiwane wprowadzanie składni przekreślenia <code class='fn__code'>~~foo~~</code>",
"editorMarkdownInlineSup": "Składnia Markdown dla indeksów dolnych w tekście",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "Не запускать автоматически",
"autoLaunchMode1": "Автозапуск после загрузки",
"autoLaunchMode2": "Автозапуск и минимизация главного интерфейса после загрузки",
"editorMarkdownInlineMark": "Markdown синтаксис встроенной разметки",
"editorMarkdownInlineMarkTip": "После включения будет поддерживаться ввод синтаксиса встроенной разметки <code class='fn__code'>==foo==</code>",
"editorMarkdownInlineStrikethrough": "Markdown синтаксис зачёркивания",
"editorMarkdownInlineStrikethroughTip": "После включения будет поддерживаться ввод синтаксиса зачёркивания <code class='fn__code'>~~foo~~</code>",
"editorMarkdownInlineSup": "Markdown синтаксис для надстрочного индекса",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "不自動啟動",
"autoLaunchMode1": "開機自動啟動",
"autoLaunchMode2": "開機後自動啟動並最小化主介面",
"editorMarkdownInlineMark": "Markdown 行級標記語法",
"editorMarkdownInlineMarkTip": "啟用後將支持 <code class='fn__code'>==foo==</code> 行級標記語法輸入",
"editorMarkdownInlineStrikethrough": "Markdown 行級刪除線語法",
"editorMarkdownInlineStrikethroughTip": "啟用後將支持 <code class='fn__code'>~~foo~~</code> 行級刪除線語法輸入",
"editorMarkdownInlineSup": "Markdown 行級上標語法",

View file

@ -62,6 +62,8 @@
"autoLaunchMode0": "不自动启动",
"autoLaunchMode1": "开机后自动启动",
"autoLaunchMode2": "开机后自动启动并最小化主界面",
"editorMarkdownInlineMark": "Markdown 行级标记语法",
"editorMarkdownInlineMarkTip": "启用后将支持 <code class='fn__code'>==foo==</code> 行级标记语法输入",
"editorMarkdownInlineStrikethrough": "Markdown 行级删除线语法",
"editorMarkdownInlineStrikethroughTip": "启用后将支持 <code class='fn__code'>~~foo~~</code> 行级删除线语法输入",
"editorMarkdownInlineSup": "Markdown 行级上标语法",

View file

@ -345,6 +345,14 @@ export const editor = {
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="editorMarkdownInlineStrikethrough" type="checkbox"${window.siyuan.config.editor.markdown.inlineStrikethrough ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.editorMarkdownInlineMark}
<div class="b3-label__text">${window.siyuan.languages.editorMarkdownInlineMarkTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="editorMarkdownInlineMark" type="checkbox"${window.siyuan.config.editor.markdown.inlineMark ? " checked" : ""}/>
</label>`;
},
bindEvent: () => {
@ -380,7 +388,8 @@ export const editor = {
inlineSub: (editor.element.querySelector("#editorMarkdownInlineSub") as HTMLInputElement).checked,
inlineTag: (editor.element.querySelector("#editorMarkdownInlineTag") as HTMLInputElement).checked,
inlineMath: (editor.element.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked,
inlineStrikethrough: (editor.element.querySelector("#editorMarkdownInlineStrikethrough") as HTMLInputElement).checked
inlineStrikethrough: (editor.element.querySelector("#editorMarkdownInlineStrikethrough") as HTMLInputElement).checked,
inlineMark: (editor.element.querySelector("#editorMarkdownInlineMark") as HTMLInputElement).checked
},
allowHTMLBLockScript: (editor.element.querySelector("#allowHTMLBLockScript") as HTMLInputElement).checked,
justify: (editor.element.querySelector("#justify") as HTMLInputElement).checked,

View file

@ -25,7 +25,7 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"listItemDotNumberClickFocus", "listItemDotNumberClickFocusTip", "editorMarkdownInlineAsterisk", "editorMarkdownInlineUnderscore",
"editorMarkdownInlineSup", "editorMarkdownInlineSupTip", "editorMarkdownInlineSub", "editorMarkdownInlineSubTip",
"editorMarkdownInlineTag", "editorMarkdownInlineTagTip", "editorMarkdownInlineMath", "editorMarkdownInlineMathTip",
"editorMarkdownInlineStrikethrough", "editorMarkdownInlineStrikethroughTip",
"editorMarkdownInlineStrikethrough", "editorMarkdownInlineStrikethroughTip", "editorMarkdownInlineMark", "editorMarkdownInlineMarkTip",
"allowHTMLBLockScript", "allowHTMLBLockScriptTip", "backlinkExpandTip", "backmentionExpandTip",
"backlinkContainChildren", "backlinkContainChildrenTip"
]),

View file

@ -21,7 +21,8 @@ const setEditor = (modelMainElement: Element) => {
inlineSub: (modelMainElement.querySelector("#editorMarkdownInlineSub") as HTMLInputElement).checked,
inlineTag: (modelMainElement.querySelector("#editorMarkdownInlineTag") as HTMLInputElement).checked,
inlineMath: (modelMainElement.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked,
inlineStrikethrough: (modelMainElement.querySelector("#editorMarkdownInlineStrikethrough") as HTMLInputElement).checked
inlineStrikethrough: (modelMainElement.querySelector("#editorMarkdownInlineStrikethrough") as HTMLInputElement).checked,
inlineMark: (modelMainElement.querySelector("#editorMarkdownInlineMark") as HTMLInputElement).checked
};
window.siyuan.config.editor.allowHTMLBLockScript = (modelMainElement.querySelector("#allowHTMLBLockScript") as HTMLInputElement).checked;
window.siyuan.config.editor.dynamicLoadBlocks = dynamicLoadBlocks;
@ -330,6 +331,14 @@ export const initEditor = () => {
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="editorMarkdownInlineStrikethrough" type="checkbox"${window.siyuan.config.editor.markdown.inlineStrikethrough ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.editorMarkdownInlineMark}
<div class="b3-label__text">${window.siyuan.languages.editorMarkdownInlineMarkTip}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="editorMarkdownInlineMark" type="checkbox"${window.siyuan.config.editor.markdown.inlineMark ? " checked" : ""}/>
</label>`,
bindEvent(modelMainElement: HTMLElement) {
modelMainElement.querySelector("#clearHistory").addEventListener("click", () => {

View file

@ -31,8 +31,9 @@ export const setLute = (options: ILuteOptions) => {
lute.SetSub(window.siyuan.config.editor.markdown.inlineSub);
lute.SetTag(window.siyuan.config.editor.markdown.inlineTag);
lute.SetInlineMath(window.siyuan.config.editor.markdown.inlineMath);
lute.SetGFMStrikethrough(window.siyuan.config.editor.markdown.inlineStrikethrough);
lute.SetGFMStrikethrough1(false);
lute.SetGFMStrikethrough(window.siyuan.config.editor.markdown.inlineStrikethrough);
lute.SetMark(window.siyuan.config.editor.markdown.inlineMark);
lute.SetSpin(true);
lute.SetProtyleWYSIWYG(true);
if (options.lazyLoadImage) {

View file

@ -225,6 +225,7 @@ export const restoreLuteMarkdownSyntax = (protyle: IProtyle) => {
protyle.lute.SetSup(window.siyuan.config.editor.markdown.inlineSup);
protyle.lute.SetTag(window.siyuan.config.editor.markdown.inlineTag);
protyle.lute.SetInlineUnderscore(window.siyuan.config.editor.markdown.inlineUnderscore);
protyle.lute.SetMark(window.siyuan.config.editor.markdown.inlineMark);
};
export const pasteText = async (protyle: IProtyle, textPlain: string, nodeElement: Element, toBlockDOM = true) => {

View file

@ -328,6 +328,10 @@ declare namespace Config {
* Whether to enable the inline strikethrough
*/
inlineStrikethrough: boolean;
/**
* Whether to enable the inline mark
*/
inlineMark: boolean;
}
/**

File diff suppressed because one or more lines are too long

View file

@ -10,7 +10,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20241212012748-c4dc08fe45ec
github.com/88250/lute v1.7.7-0.20250203034904-0b113a23dc83
github.com/88250/lute v1.7.7-0.20250213081327-5ddd3fb96d0e
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
github.com/ConradIrwin/font v0.2.1

View file

@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20241212012748-c4dc08fe45ec h1:YsUSpByWJP+x8C+IT+C3QlFvU7ZQ6+E95SFd9+zy6QU=
github.com/88250/gulu v1.2.3-0.20241212012748-c4dc08fe45ec/go.mod h1:c8uVw25vW2W4dhJ/j4iYsX5H1hc19spim266jO5x2hU=
github.com/88250/lute v1.7.7-0.20250203034904-0b113a23dc83 h1:DaFXbNEJVSl2OKY7lWVQsmS3PSjcHpNCcJrzO/A3gng=
github.com/88250/lute v1.7.7-0.20250203034904-0b113a23dc83/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/lute v1.7.7-0.20250213081327-5ddd3fb96d0e h1:oEAhoLd2eU9Qsqjos34rjccC3d93pB4ULEYqaDZnmBw=
github.com/88250/lute v1.7.7-0.20250213081327-5ddd3fb96d0e/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01 h1:AcFe63RXjIh1XtX/dc4Es3U8bYKjlEkvavHd1nFBOHM=
github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -1525,7 +1525,9 @@ func highlightByFTS(query, typeFilter, id string) (ret []string) {
"highlight(" + table + ", 9, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS memo, " +
"highlight(" + table + ", 10, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS tag, " +
"highlight(" + table + ", 11, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS content, " +
"fcontent, markdown, length, type, subtype, ial, sort, created, updated"
"fcontent, markdown, length, type, subtype, " +
"highlight(" + table + ", 17, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS ial, " +
"sort, created, updated"
stmt := "SELECT " + projections + " FROM " + table + " WHERE (`" + table + "` MATCH '" + columnFilter() + ":(" + query + ")'"
stmt += ") AND type IN " + typeFilter
stmt += " AND root_id = '" + id + "'"
@ -1552,6 +1554,10 @@ func highlightByFTS(query, typeFilter, id string) (ret []string) {
if 0 < len(keyword) {
ret = append(ret, keyword...)
}
keyword = gulu.Str.SubstringsBetween(block.IAL, search.SearchMarkLeft, search.SearchMarkRight)
if 0 < len(keyword) {
ret = append(ret, keyword...)
}
keyword = gulu.Str.SubstringsBetween(block.Content, search.SearchMarkLeft, search.SearchMarkRight)
if 0 < len(keyword) {
ret = append(ret, keyword...)

View file

@ -33,6 +33,7 @@ var MarkdownSettings = &Markdown{
InlineTag: true,
InlineMath: true,
InlineStrikethrough: true,
InlineMark: true,
}
type Markdown struct {
@ -43,6 +44,7 @@ type Markdown struct {
InlineTag bool `json:"inlineTag"` // 是否启用行级标签
InlineMath bool `json:"inlineMath"` // 是否启用行级公式
InlineStrikethrough bool `json:"inlineStrikethrough"` // 是否启用行级删除线
InlineMark bool `json:"inlineMark"` // 是否启用行级标记
}
func NewLute() (ret *lute.Lute) {
@ -64,6 +66,7 @@ func NewLute() (ret *lute.Lute) {
ret.SetTag(MarkdownSettings.InlineTag)
ret.SetInlineMath(MarkdownSettings.InlineMath)
ret.SetGFMStrikethrough(MarkdownSettings.InlineStrikethrough)
ret.SetMark(MarkdownSettings.InlineMark)
ret.SetInlineMathAllowDigitAfterOpenMarker(true)
ret.SetGFMStrikethrough1(false)
ret.SetFootnotes(false)