Meet Vekaria32 downloadsRemoves blank lines between list items with a toggle to control strict in-list-only removal.
Remove unwanted blank lines between list items in Markdown. Adds a command you can run from the Command Palette to clean up lists. Supports two modes:
Markdown lists can become “loose” or visually odd when indented blank lines sneak in (often due to copy/paste or accidental tabs/spaces on empty lines). This plugin cleans those up without collapsing truly separate lists (in strict mode). The most prominent case of unwanted lines creeping in is when we copy text from GPT tools like ChatGPT, Perplexity, Gemini, etc. Their standard rendering format shows the list correctly, but when we copy and paste that content in Obsidian, unnecessary tabbed blank lines are added between each list item.
Strict mode ON: Between two list items: remove blank lines that contain any spaces/tabs; keep exactly one pure empty blank line if it’s acting as a separator between lists. After the last item of a list followed by another list: drop any trailing indented blanks; keep exactly one pure empty blank line as the separator. At end of document: drop trailing indented blanks after the last list item; do not keep a trailing empty line.
Strict mode OFF: Remove any blank lines between list items (merges lists). Remove trailing blanks after the last list item, including at end of document.
Input:
- List 1 Item 1
- List 1 Item 2
- List 1 Item 3
- List 1 Item 4
- List 1 Item 5
- List 1 Item 6
- List 2 Item 1
- List 2 Item 2
- List 2 Item 3
- List 2 Item 4
- List 2 Item 5
- List 2 Item 6
- List 3 Item 1
- List 3 Item 2
- List 3 Item 3
- List 3 Item 4
- List 3 Item 5
- List 3 Item 6
Output (strict mode ON):
- List 1 Item 1
- List 1 Item 2
- List 1 Item 3
- List 1 Item 4
- List 1 Item 5
- List 1 Item 6
- List 2 Item 1
- List 2 Item 2
- List 2 Item 3
- List 2 Item 4
- List 2 Item 5
- List 2 Item 6
- List 3 Item 1
- List 3 Item 2
- List 3 Item 3
- List 3 Item 4
- List 3 Item 5
- List 3 Item 6
Output (strict mode OFF):
- List 1 Item 1
- List 1 Item 2
- List 1 Item 3
- List 1 Item 4
- List 1 Item 5
- List 1 Item 6
- List 2 Item 1
- List 2 Item 2
- List 2 Item 3
- List 2 Item 4
- List 2 Item 5
- List 2 Item 6
- List 3 Item 1
- List 3 Item 2
- List 3 Item 3
- List 3 Item 4
- List 3 Item 5
- List 3 Item 6
(NOTE: Not available in community plugins as of now. The process is in progress.)
Uses only the public Obsidian plugin API and browser-safe code. Works on desktop and mobile.
Clean Lists Copyright (c) 2025 MEET VEKARIA
This product includes software and documentation licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Required attribution:
Additional notices:
If you find issues or have feature requests, open an issue in the repository.
Created with ❤️ Meet Vekaria.
If you found this useful, I invite you to:
Buy Me a Coffee: "https://buymeacoffee.com/meet.v",
Be a GitHub Sponsor: "https://github.com/sponsors/meet-v"