A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: rename to markdown shortcuts
Abdullah Atta3465a816c68b
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsxindex 8d32bb835..9b4c3bc75 100644--- a/apps/web/src/components/editor/tiptap.tsx+++ b/apps/web/src/components/editor/tiptap.tsx@@ -141,7 +141,9 @@ function TipTap(props: TipTapProps) {);const dateFormat = useSettingsStore((store) => store.dateFormat);const timeFormat = useSettingsStore((store) => store.timeFormat);- const inputRules = useSettingsStore((store) => store.inputRules);+ const markdownShortcuts = useSettingsStore(+ (store) => store.markdownShortcuts+ );const { toolbarConfig } = useToolbarConfig();const { isSearching, toggleSearch } = useSearch();@@ -181,7 +183,7 @@ function TipTap(props: TipTapProps) {}}},- enableInputRules: inputRules,+ enableInputRules: markdownShortcuts,downloadOptions,doubleSpacedLines,dateFormat,@@ -292,7 +294,14 @@ function TipTap(props: TipTapProps) {},getAttachmentData: onGetAttachmentData};- }, [readonly, nonce, doubleSpacedLines, dateFormat, timeFormat, inputRules]);+ }, [+ readonly,+ nonce,+ doubleSpacedLines,+ dateFormat,+ timeFormat,+ markdownShortcuts+ ]);const editor = useTiptap(tiptapOptions,diff --git a/apps/web/src/dialogs/settings/editor-settings.ts b/apps/web/src/dialogs/settings/editor-settings.tsindex 2d1d6a2d0..3ad182b7d 100644--- a/apps/web/src/dialogs/settings/editor-settings.ts+++ b/apps/web/src/dialogs/settings/editor-settings.ts@@ -114,24 +114,23 @@ symbols (e.g. 202305261253)`,]},{- key: "input-rules",- title: "Input rules",- description: `Input rules are triggered whenever you input a specific character combination.+ key: "markdown-shortcuts",+ title: "Markdown shortcuts",+ description: `Markdown shortcuts are triggered whenever you input a specific character combination.-A few examples of this:+For example:1. Typing '/date' adds the current Date2. Wrapping something in '**' turns it into bold text3. Typing '1.' automatically creates a numbered list.--This behavior can be disabled via this setting.`,+4. etc.`,onStateChange: (listener) =>- useSettingStore.subscribe((c) => c.inputRules, listener),+ useSettingStore.subscribe((c) => c.markdownShortcuts, listener),components: [{type: "toggle",- isToggled: () => useSettingStore.getState().inputRules,- toggle: () => useSettingStore.getState().toggleInputRules()+ isToggled: () => useSettingStore.getState().markdownShortcuts,+ toggle: () => useSettingStore.getState().toggleMarkdownShortcuts()}]}diff --git a/apps/web/src/stores/setting-store.js b/apps/web/src/stores/setting-store.jsindex 36593ee3c..3c91791d9 100644--- a/apps/web/src/stores/setting-store.js+++ b/apps/web/src/stores/setting-store.js@@ -38,7 +38,7 @@ class SettingStore extends BaseStore {PATHS.backupsDirectory);doubleSpacedParagraphs = Config.get("doubleSpacedLines", true);- inputRules = Config.get("inputRules", true);+ markdownShortcuts = Config.get("markdownShortcuts", true);notificationsSettings = Config.get("notifications", { reminder: true });zoomFactor = 1.0;@@ -167,11 +167,11 @@ class SettingStore extends BaseStore {Config.set("doubleSpacedLines", !doubleSpacedParagraphs);};- toggleInputRules = (toggleState) => {+ toggleMarkdownShortcuts = (toggleState) => {this.set((state) => {- state.inputRules =- toggleState !== undefined ? toggleState : !state.inputRules;- Config.set("inputRules", state.inputRules);+ state.markdownShortcuts =+ toggleState !== undefined ? toggleState : !state.markdownShortcuts;+ Config.set("markdownShortcuts", state.markdownShortcuts);});};