Indent

approved

by Jan Sandström

This plugin has not been manually reviewed by Obsidian staff. Disable indented code blocks so tabs/spaces become normal indentation.

3 stars543 downloadsUpdated 2mo agoMIT

Indent (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)

  1. Install dependencies:
    • npm install
  2. Build:
    • npm run build
  3. Watch mode:
    • npm run dev

Notes

This intentionally deviates from CommonMark by neutralizing indented code blocks.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.