From 521d4d7b043033162f0e9936c92e6a2a41b9dc51 Mon Sep 17 00:00:00 2001 From: ipshing Date: Fri, 29 Aug 2025 15:37:35 -0700 Subject: [PATCH] Remove inner spaces in PascalCase --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 2997ad7..ecec7cd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,7 +78,9 @@ export default class TextTransform extends Plugin { editorCallback: (editor) => { if (editor.hasFocus()) { const info = this.getSelectionInfo(editor); - const newText = changeTextCase(info.selectedText, TextCase.PascalCase, this.settings.wordBoundaryChars, this.settings.titleCaseIgnore); + const newText = changeTextCase(info.selectedText, TextCase.PascalCase, this.settings.wordBoundaryChars, this.settings.titleCaseIgnore) + // Remove all spaces that aren't leading/trailing + .replace(/(?<=\S)\s+(?=\S)/g, ""); this.replaceSelection(editor, newText, info); } },