From a7db8ef418e189226292e66d45bec9d5c480f7d3 Mon Sep 17 00:00:00 2001 From: Heiko Joerg Schick Date: Wed, 29 Apr 2026 23:01:08 +0200 Subject: [PATCH] Fix line case in command names, type-safety in applyInlineMarkdown, and versions.json --- src/commands.ts | 18 +++++++++--------- src/formatter.ts | 4 ++-- versions.json | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index 2cb90db..c39bf2a 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -15,12 +15,12 @@ function addFormatCommand(plugin: Plugin, style: FormatStyle, name: string) { } export function registerCommands(plugin: Plugin): void { - addFormatCommand(plugin, "bold", "Format as Unicode Bold"); - addFormatCommand(plugin, "italic", "Format as Unicode Italic"); - addFormatCommand(plugin, "bold-italic", "Format as Unicode Bold Italic"); + addFormatCommand(plugin, "bold", "Format as unicode bold"); + addFormatCommand(plugin, "italic", "Format as unicode italic"); + addFormatCommand(plugin, "bold-italic", "Format as unicode bold italic"); plugin.addCommand({ id: "unicode-formatter:clean", - name: "Remove Unicode Formatting", + name: "Remove unicode formatting", editorCallback: (editor) => { const selection = editor.getSelection(); if (selection) { @@ -30,7 +30,7 @@ export function registerCommands(plugin: Plugin): void { }); plugin.addCommand({ id: "unicode-formatter:bullet-to-arrow", - name: "Convert List Bullets to Arrow", + name: "Convert list bullets to arrow", editorCallback: (editor) => { const selection = editor.getSelection(); if (selection) { @@ -40,7 +40,7 @@ export function registerCommands(plugin: Plugin): void { }); plugin.addCommand({ id: "unicode-formatter:bullet-to-emdash", - name: "Convert List Bullets to Em Dash", + name: "Convert list bullets to em dash", editorCallback: (editor) => { const selection = editor.getSelection(); if (selection) { @@ -50,7 +50,7 @@ export function registerCommands(plugin: Plugin): void { }); plugin.addCommand({ id: "unicode-formatter:numbered-list-slash", - name: "Convert List to Numbered (Slash)", + name: "Convert list to numbered (slash)", editorCallback: (editor) => { const selection = editor.getSelection(); if (selection) { @@ -60,7 +60,7 @@ export function registerCommands(plugin: Plugin): void { }); plugin.addCommand({ id: "unicode-formatter:numbered-list-parens", - name: "Convert List to Numbered (Parentheses)", + name: "Convert list to numbered (parentheses)", editorCallback: (editor) => { const selection = editor.getSelection(); if (selection) { @@ -70,7 +70,7 @@ export function registerCommands(plugin: Plugin): void { }); plugin.addCommand({ id: "unicode-formatter:markdown-to-linkedin", - name: "Convert Markdown to Post Format", + name: "Convert Markdown to post format", editorCallback: (editor) => { const selection = editor.getSelection(); if (selection) { diff --git a/src/formatter.ts b/src/formatter.ts index aca768d..749b268 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -76,9 +76,9 @@ export function numberedListParens(text: string): string { } export function applyInlineMarkdown(text: string): string { - return text.replace(/\*\*(.+?)\*\*|_(.+?)_/g, (_match, bold, italic) => { + return text.replace(/\*\*(.+?)\*\*|_(.+?)_/g, (_match, bold: string | undefined, italic: string | undefined) => { if (bold !== undefined) return transformText(bold, "bold"); - return transformText(italic, "italic"); + return transformText(italic!, "italic"); }); } diff --git a/versions.json b/versions.json index 26382a1..189c17e 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "1.0.0": "0.15.0" + "1.0.0": "0.15.0", + "1.0.1": "0.15.0" }