Markdown Autofix
approvedby swift
Detects Markdown syntax errors in the active note in real time and automatically fixes the safely fixable ones. - This plugin has not been manually reviewed by Obsidian staff.
Markdown Autofix
An Obsidian plugin that detects Markdown syntax errors in the active note in real time and automatically fixes the safely fixable ones.
Features
- Real-time detection — scans the current Markdown document after you pause typing (800 ms debounce), on file open, and on plugin load.
- Auto-fix — errors with a unique safe fix are repaired automatically through an editor transaction (fully undoable with Ctrl/Cmd+Z).
- Error display (toggleable) — wavy underlines with hover tooltips in the editor, plus an error count in the status bar. Can be turned on/off from Settings or the command palette (
开关错误实时显示). - Error list panel — click the ribbon icon (left sidebar) or run
打开错误列表面板to open a right-sidebar panel. Issues are grouped by type under collapsible headers: auto-fixable groups come first with a per-group一键修复batch button (plus a global全部一键修复), review-only groups are tagged需人工审核. Click any item to jump to its location; fixable items also have an individual修复button. - Heading level shift — select a range of text and run
选区内标题提升一级/选区内标题降低一级from the command palette to promote/demote every heading inside the selection by one level (H1/H6 boundaries are left untouched, code fences are ignored, single undo step). - Safety guards — the line your cursor is on is never checked or modified; content inside code fences is ignored.
Detection rules (22, each individually toggleable, markdownlint-inspired)
Auto-fixed:
| Rule | Fix |
|---|---|
Heading # missing a following space (MD018) | Insert a space |
Unclosed inline markers (**, ~~, ==, `) | Append the marker at line end |
Link/image missing the closing ) | Append ) |
| Unclosed code fence | Append ``` at end of file |
| Table missing the separator row | Insert | --- | row matching column count |
| Multiple consecutive blank lines (MD012) | Collapse to one |
| Blank lines containing spaces/tabs | Clear to truly empty |
| Trailing whitespace (MD009, 2-space hard break allowed) | Trim |
| Hard tabs (MD010) | Replace with 4 spaces |
| Heading indented from the left margin (MD023) | Remove indentation |
| Heading ending with punctuation (MD026) | Strip trailing punctuation |
| Headings not surrounded by blank lines (MD022) | Insert blank lines |
| Code fences not surrounded by blank lines (MD031) | Insert blank lines |
Spaces inside emphasis markers ** text ** (MD037) | Remove inner spaces |
Spaces inside code spans ` code ` (MD038) | Remove inner spaces |
| File not ending with exactly one newline (MD047) | Normalize EOF newline |
Display only (no unique safe fix): empty link [](), multiple H1 headings (MD025), heading level jumps (MD001), code fence without a language (MD040), bare URLs (MD034), emphasis used as a heading (MD036), inline HTML (MD033).
Installation
- Run
npm install && npm run buildin this directory. - Copy
main.js,manifest.json, andstyles.cssinto<your-vault>/.obsidian/plugins/markdown-autofix/. - Enable "Markdown Autofix" in Settings → Community plugins.
Privacy
- No network access, no telemetry, no external services.
- The plugin only reads and modifies the currently active Markdown document in the editor. All edits go through normal editor transactions and are undoable.
- Settings (toggles) are stored locally in the plugin's
data.jsoninside your vault.
中文说明
实时检测当前笔记的 Markdown 语法错误并自动修复(可撤销)。错误波浪线显示可在设置或命令面板中开关;光标所在行与代码围栏内的内容不会被检测或修改。
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.