README file from
GithubIndent (Obsidian Plugin)
Disable indented code blocks so tabs/spaces become normal indentation in Live Preview.
How it works
Obsidian’s Markdown parser turns any line that starts with 4+ spaces or a tab into an indented code block. Instead of modifying the parser, this plugin rewrites the start of affected lines on edit:
- When a line begins with a tab or 4+ spaces, the plugin prefixes the indentation with a zero‑width non‑joiner (ZWNJ, U+200C).
- That invisible character breaks the “indented code block” rule, but keeps the indentation visible.
- Lines inside YAML frontmatter, fenced code blocks (``` or ~~~), lists, and blockquotes are left untouched.
The change is applied in the editor only, right after edits, so you can keep using Tab normally.
Features
- Treats indented lines as normal text (no indented code blocks).
- Preserves fenced code blocks.
- Avoids touching list and quote lines.
- Uses your actual typed indentation (tabs or spaces).
- Toggle on/off in the plugin settings.
Development (esbuild)
- Install dependencies:
npm install
- Build:
npm run build
- Watch mode:
npm run dev
Notes
This intentionally deviates from CommonMark by neutralizing indented code blocks.