Skip to content

Commit

Permalink
don't merge lines if multi-\n
Browse files Browse the repository at this point in the history
  • Loading branch information
Benature committed Jun 13, 2021
1 parent 9f8b9ed commit bc1ff51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class Underline extends Plugin {
// replacedText = replacedText.replace(/\n /g, "\n"); // when a single space left at the head of the line
break;
case "newline":
replacedText = selectedText.replace(/\n/g, " ");
replacedText = selectedText.replace(/(?<!\n)\n(?!\n)/g, " ");
// replacedText = selectedText.replace(/ +/g, " ");
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-text-format",
"name": "Text Format",
"version": "0.2.1",
"version": "0.2.2",
"minAppVersion": "0.9.7",
"description": "Format selected text lowercase/uppercase/capitalize/titlecase or remove redundant spaces/newline characters.",
"author": "Benature",
Expand Down

0 comments on commit bc1ff51

Please sign in to comment.