mirror of
https://github.com/ipshing/obsidian-text-transform.git
synced 2026-07-22 08:30:29 +00:00
Remove inner spaces in PascalCase
This commit is contained in:
parent
8a7221b946
commit
521d4d7b04
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue