diff --git a/README.md b/README.md index c3272e9..a09ccce 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The Paste Reformatter plugin automatically processes content when you paste it i 4. Applies Markdown transformations (heading adjustments, line break handling, regex string replacement) 5. Inserts the transformed content at the cursor position -A notification will appear briefly indicating whether HTML or plain text content was reformatted. +A notification will appear briefly indicating whether HTML or plain text content was reformatted. This can be disabled in settings. ### Commands @@ -62,6 +62,10 @@ Paste Reformatter can potentially conflict with other Obsidian plugins that over When this setting is enabled, the default behavior of Obsidian's Paste function will be enhanced. Otherwise, **Reformat and Paste** command can be bound to an alternative hot-key to get enhanced paste behavior. +#### Show paste notifications + +When enabled, a notice appears after reformatting content. Disable this to hide notifications. + ### HTML Transformations These settings control how HTML content is processed before being converted to Markdown. diff --git a/manifest.json b/manifest.json index 0529171..0011daa 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "paste-reformatter", "name": "Paste Reformatter", - "version": "1.3.0", + "version": "1.4.0", "minAppVersion": "0.15.0", "description": "Reformat pasted text for precise control.", "author": "Keath Milligan", diff --git a/package.json b/package.json index cbe891e..0490dbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-sample-plugin", - "version": "1.3.0", + "version": "1.4.0", "description": "This is a sample plugin for Obsidian (https://obsidian.md)", "main": "dist/main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index c501c34..354f1f8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,6 +12,7 @@ interface RegexReplacement { interface PasteReformmatterSettings { pasteOverride: boolean; // Whether to override the default paste behavior + showPasteNotifications: boolean; // Whether to show a notice after successful paste reformatting maxHeadingLevel: number; // The maximum heading level to allow (1-6, where 1 is disabled) removeEmptyElements: boolean; // Whether to remove empty elements when reformatting pasted content cascadeHeadingLevels: boolean; // Whether to cascade heading levels (e.g., H1→H2→H3 becomes H2→H3→H4 when max level is H2) @@ -25,6 +26,7 @@ interface PasteReformmatterSettings { const DEFAULT_SETTINGS: PasteReformmatterSettings = { pasteOverride: true, + showPasteNotifications: true, maxHeadingLevel: 1, removeEmptyElements: false, cascadeHeadingLevels: true, @@ -191,7 +193,9 @@ export default class PasteReformatter extends Plugin { if (appliedHTMLTransformations || appliedMarkdownTransformations) { // Replace the current selection with the converted markdown editor.replaceSelection(markdownResult.markdown); - new Notice(`Reformatted pasted content`); + if (this.settings.showPasteNotifications) { + new Notice(`Reformatted pasted content`); + } return true; } else { return false; @@ -302,6 +306,16 @@ class PasteReformmatterSettingsTab extends PluginSettingTab { this.plugin.settings.pasteOverride = value; await this.plugin.saveSettings(); })); + + new Setting(containerEl) + .setName('Show paste notifications') + .setDesc('Display a notice when pasted content is reformatted.') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.showPasteNotifications) + .onChange(async (value) => { + this.plugin.settings.showPasteNotifications = value; + await this.plugin.saveSettings(); + })); // HTML Transformations new Setting(containerEl) diff --git a/versions.json b/versions.json index bce5541..38f33e0 100644 --- a/versions.json +++ b/versions.json @@ -5,5 +5,6 @@ "1.2.0": "0.15.0", "1.2.1": "0.15.0", "1.2.2": "0.15.0", - "1.3.0": "0.15.0" + "1.3.0": "0.15.0", + "1.4.0": "0.15.0" } \ No newline at end of file