Adds four commands:
Remove newlines from selection and Paste without newlines can remove newlines from text. They can turn hard-wrapped text into a single paragraph. These commands can optionally remove word-break hyphenation and fix consecutive whitespace issues. This is especially useful when pasting text from a PDF.Remove blank lines from selection and Paste without blank lines can remove blank lines from text. These commands are especially useful when pasting content from the web, which can often have a gratuitous amount of blank lines and whitespace.The commands will appear in the context menu (right-click), but can also be invoked via the Command Palette or bound to a keyboard shortcut.
I started developing remove-newlines because copy-pasting quotes from PDFs into my Obsidian notes involved a lot of tedious clean-up work. Since then, it has saved me countless hours of cleaning up ugly text formatting. People tend to use this plugin for the following use cases:
Paste without newlines will fix it.Paste without blank lines can fix it.Paste without blank lines.Remove blank lines from selection is useful when cleaning up large drafts with lots of whitespace.



You can change how Remove Newlines handles word-break hyphenation and consecutive whitespace (when removing newlines) by visiting the plugin’s settings tab.

There are no hotkeys for these actions by default, but you can create them in the settings modal under the “Hotkeys” section.

CR, LF, and/or CR LF line endings.remove-newlines folder in your vault’s plugins/ directory: <YourVaultFolder>/.obsidian/plugins/remove-newlinesmain.js, styles.css, and manifest.json into the remove-newlines/ folder you created in step 2.If you encounter any issues, please report them on the issue tracker for this plugin. For help with pasting-related commands, please be sure to note what operating system and applications you are using (e.g. Windows, pasting text from Chrome).
If you’d like to request a feature or have an idea for a new feature, please use the GitHub issue tracker.
All relevant source code can be found in main.ts and also utils.ts. To compile yourself from source:
cd to the project foldernpm run dev or npm run build