SilverBullet library that cleans up markdown in an opinionated (and SilverBullet optimized) way. It adds a Markdown: Prettify command (default Ctrl-Alt-p / Cmd-Alt-p) to clean up the current page (or selection) using an ordered pipeline of ParseTree-based rules.
See MarkdownPrettify.md for a full description of the rules, configuration schema, and install instructions.
In SilverBullet, run Library: Install and paste the URL to Prettify.md in this repo.
npm install
npm run buildThis produces markdown-prettify.plug.js next to the source files, which the SilverBullet client will pick up automatically (watch the browser console, then run Plugs: Reload).
npx vitest runOnly the pure string-level finalizeWhitespace tests ship in this standalone repo — the ParseTree-based rule tests require SilverBullet's internal markdown parser and run inside Core instead.
- In your SilverBullet space, create a namespace folder, e.g.
Library/zefhemel/. - Symlink this repo into it:
ln -s "$PWD" ~/myspace/Library/silverbulletmd/markdown-prettify
- Run
npm run buildwhenever you change source files; SilverBullet reloads the plug automatically (or runPlugs: Reloadto force).
MIT