Indent

by Jan Sandström
5
4
3
2
1
Score: 35/100
New Plugin

Description

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

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
0
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

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.