Fix line case in command names, type-safety in applyInlineMarkdown, and versions.json
This commit is contained in:
+9
-9
@@ -15,12 +15,12 @@ function addFormatCommand(plugin: Plugin, style: FormatStyle, name: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function registerCommands(plugin: Plugin): void {
|
export function registerCommands(plugin: Plugin): void {
|
||||||
addFormatCommand(plugin, "bold", "Format as Unicode Bold");
|
addFormatCommand(plugin, "bold", "Format as unicode bold");
|
||||||
addFormatCommand(plugin, "italic", "Format as Unicode Italic");
|
addFormatCommand(plugin, "italic", "Format as unicode italic");
|
||||||
addFormatCommand(plugin, "bold-italic", "Format as Unicode Bold Italic");
|
addFormatCommand(plugin, "bold-italic", "Format as unicode bold italic");
|
||||||
plugin.addCommand({
|
plugin.addCommand({
|
||||||
id: "unicode-formatter:clean",
|
id: "unicode-formatter:clean",
|
||||||
name: "Remove Unicode Formatting",
|
name: "Remove unicode formatting",
|
||||||
editorCallback: (editor) => {
|
editorCallback: (editor) => {
|
||||||
const selection = editor.getSelection();
|
const selection = editor.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
@@ -30,7 +30,7 @@ export function registerCommands(plugin: Plugin): void {
|
|||||||
});
|
});
|
||||||
plugin.addCommand({
|
plugin.addCommand({
|
||||||
id: "unicode-formatter:bullet-to-arrow",
|
id: "unicode-formatter:bullet-to-arrow",
|
||||||
name: "Convert List Bullets to Arrow",
|
name: "Convert list bullets to arrow",
|
||||||
editorCallback: (editor) => {
|
editorCallback: (editor) => {
|
||||||
const selection = editor.getSelection();
|
const selection = editor.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
@@ -40,7 +40,7 @@ export function registerCommands(plugin: Plugin): void {
|
|||||||
});
|
});
|
||||||
plugin.addCommand({
|
plugin.addCommand({
|
||||||
id: "unicode-formatter:bullet-to-emdash",
|
id: "unicode-formatter:bullet-to-emdash",
|
||||||
name: "Convert List Bullets to Em Dash",
|
name: "Convert list bullets to em dash",
|
||||||
editorCallback: (editor) => {
|
editorCallback: (editor) => {
|
||||||
const selection = editor.getSelection();
|
const selection = editor.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
@@ -50,7 +50,7 @@ export function registerCommands(plugin: Plugin): void {
|
|||||||
});
|
});
|
||||||
plugin.addCommand({
|
plugin.addCommand({
|
||||||
id: "unicode-formatter:numbered-list-slash",
|
id: "unicode-formatter:numbered-list-slash",
|
||||||
name: "Convert List to Numbered (Slash)",
|
name: "Convert list to numbered (slash)",
|
||||||
editorCallback: (editor) => {
|
editorCallback: (editor) => {
|
||||||
const selection = editor.getSelection();
|
const selection = editor.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
@@ -60,7 +60,7 @@ export function registerCommands(plugin: Plugin): void {
|
|||||||
});
|
});
|
||||||
plugin.addCommand({
|
plugin.addCommand({
|
||||||
id: "unicode-formatter:numbered-list-parens",
|
id: "unicode-formatter:numbered-list-parens",
|
||||||
name: "Convert List to Numbered (Parentheses)",
|
name: "Convert list to numbered (parentheses)",
|
||||||
editorCallback: (editor) => {
|
editorCallback: (editor) => {
|
||||||
const selection = editor.getSelection();
|
const selection = editor.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
@@ -70,7 +70,7 @@ export function registerCommands(plugin: Plugin): void {
|
|||||||
});
|
});
|
||||||
plugin.addCommand({
|
plugin.addCommand({
|
||||||
id: "unicode-formatter:markdown-to-linkedin",
|
id: "unicode-formatter:markdown-to-linkedin",
|
||||||
name: "Convert Markdown to Post Format",
|
name: "Convert Markdown to post format",
|
||||||
editorCallback: (editor) => {
|
editorCallback: (editor) => {
|
||||||
const selection = editor.getSelection();
|
const selection = editor.getSelection();
|
||||||
if (selection) {
|
if (selection) {
|
||||||
|
|||||||
+2
-2
@@ -76,9 +76,9 @@ export function numberedListParens(text: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function applyInlineMarkdown(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");
|
if (bold !== undefined) return transformText(bold, "bold");
|
||||||
return transformText(italic, "italic");
|
return transformText(italic!, "italic");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"1.0.0": "0.15.0"
|
"1.0.0": "0.15.0",
|
||||||
|
"1.0.1": "0.15.0"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user