mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +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
|
|
@ -319,6 +319,14 @@ export const editor = {
|
|||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-switch fn__flex-center" id="editorMarkdownInlineMath" type="checkbox"${window.siyuan.config.editor.markdown.inlineMath ? " checked" : ""}/>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.editorMarkdownInlineStrikethrough}
|
||||
<div class="b3-label__text">${window.siyuan.languages.editorMarkdownInlineStrikethroughTip}</div>
|
||||
</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>`;
|
||||
},
|
||||
bindEvent: () => {
|
||||
|
|
@ -353,7 +361,8 @@ export const editor = {
|
|||
inlineSup: (editor.element.querySelector("#editorMarkdownInlineSup") as HTMLInputElement).checked,
|
||||
inlineSub: (editor.element.querySelector("#editorMarkdownInlineSub") as HTMLInputElement).checked,
|
||||
inlineTag: (editor.element.querySelector("#editorMarkdownInlineTag") as HTMLInputElement).checked,
|
||||
inlineMath: (editor.element.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked
|
||||
inlineMath: (editor.element.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked,
|
||||
inlineStrikethrough: (editor.element.querySelector("#editorMarkdownInlineStrikethrough") as HTMLInputElement).checked
|
||||
},
|
||||
allowHTMLBLockScript: (editor.element.querySelector("#allowHTMLBLockScript") as HTMLInputElement).checked,
|
||||
justify: (editor.element.querySelector("#justify") as HTMLInputElement).checked,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ const setEditor = (modelMainElement: Element) => {
|
|||
inlineSup: (modelMainElement.querySelector("#editorMarkdownInlineSup") as HTMLInputElement).checked,
|
||||
inlineSub: (modelMainElement.querySelector("#editorMarkdownInlineSub") as HTMLInputElement).checked,
|
||||
inlineTag: (modelMainElement.querySelector("#editorMarkdownInlineTag") as HTMLInputElement).checked,
|
||||
inlineMath: (modelMainElement.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked
|
||||
inlineMath: (modelMainElement.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked,
|
||||
inlineStrikethrough: (modelMainElement.querySelector("#editorMarkdownInlineStrikethrough") as HTMLInputElement).checked
|
||||
};
|
||||
window.siyuan.config.editor.allowHTMLBLockScript = (modelMainElement.querySelector("#allowHTMLBLockScript") as HTMLInputElement).checked;
|
||||
window.siyuan.config.editor.dynamicLoadBlocks = dynamicLoadBlocks;
|
||||
|
|
@ -312,6 +313,14 @@ export const initEditor = () => {
|
|||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-switch fn__flex-center" id="editorMarkdownInlineMath" type="checkbox"${window.siyuan.config.editor.markdown.inlineMath ? " checked" : ""}/>
|
||||
</label>
|
||||
<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.editorMarkdownInlineStrikethrough}
|
||||
<div class="b3-label__text">${window.siyuan.languages.editorMarkdownInlineStrikethroughTip}</div>
|
||||
</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>`,
|
||||
bindEvent(modelMainElement: HTMLElement) {
|
||||
modelMainElement.querySelector("#clearHistory").addEventListener("click", () => {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ 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.SetSpin(true);
|
||||
lute.SetProtyleWYSIWYG(true);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?
|
|||
protyle.lute.SetSub(window.siyuan.config.editor.markdown.inlineSub);
|
||||
protyle.lute.SetTag(window.siyuan.config.editor.markdown.inlineTag);
|
||||
protyle.lute.SetInlineMath(window.siyuan.config.editor.markdown.inlineMath);
|
||||
protyle.lute.SetGFMStrikethrough(window.siyuan.config.editor.markdown.inlineStrikethrough);
|
||||
protyle.lute.SetGFMStrikethrough1(false);
|
||||
addLoading(protyle);
|
||||
if (protyle.options.backlinkData) {
|
||||
|
|
|
|||
4
app/src/types/config.d.ts
vendored
4
app/src/types/config.d.ts
vendored
|
|
@ -312,6 +312,10 @@ declare namespace Config {
|
|||
* Whether to enable the inline math
|
||||
*/
|
||||
inlineMath: boolean;
|
||||
/**
|
||||
* Whether to enable the inline strikethrough
|
||||
*/
|
||||
inlineStrikethrough: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
2
app/src/types/protyle.d.ts
vendored
2
app/src/types/protyle.d.ts
vendored
|
|
@ -206,6 +206,8 @@ declare class Lute {
|
|||
|
||||
public SetInlineMath(enable: boolean): void;
|
||||
|
||||
public SetGFMStrikethrough(enable: boolean): void;
|
||||
|
||||
public SetGFMStrikethrough1(enable: boolean): void;
|
||||
|
||||
public SetMark(enable: boolean): void;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue