DEV Community

yanlong wang
yanlong wang

Posted on Originally published at tools.aicreditsapi.com

Grammar Checking Markdown Without Breaking Code Blocks: What Actually Works

Markdown is the default format for developer writing: READMEs, CHANGELOGs, docs sites, blog posts. It is also the format most grammar checkers handle worst - because Markdown is prose interleaved with syntax and code, and general-purpose checkers treat all of it as one text stream.

What Goes Wrong

Markdown element What a prose checker does What should happen
Fenced block

 | Checked as sentences; identifiers flagged | Skipped entirely |
| Inline `code` | Backticks and casing flagged | Preserved as literal |
| Link syntax `[text](url)` | URL treated as a word soup | Only the link text checked |
| Table rows | Read as fragments, flagged | Cell text checked, pipes ignored |
| Front matter | YAML keys "corrected" | Skipped entirely |

The worst outcome is not false positives - it is a checker that *auto-corrects* and rewrites a URL or changes `None` to `none`, breaking the document while claiming to fix it.

## What a Markdown-Safe Checker Must Do

1. **Parse before checking:** split the document into prose regions and code/syntax regions, and only check the prose
2. **Preserve spans:** inline code, links, and emphasis markers must survive any edit byte-for-byte
3. **Show, then apply:** fixes should be reviewable one by one, never silently applied to the whole file

## Tools in This Space

LanguageTool integrations and Word's checker will process Markdown, but as plain text with the failure modes above. Linters like vale check style rules, not grammar, and need per-project configuration. [Lint's grammar checker](https://tools.aicreditsapi.com/tools/grammar-check) is built for exactly this input: fenced blocks, inline code, and commands are recognized and skipped by design, and suggestions never rewrite code spans. It runs in the browser - paste the Markdown, review flagged items, keep everything else untouched. The same engine powers its [readability analyzer](https://tools.aicreditsapi.com/tools/readability-analyzer), which excludes code lines from scoring.

[Try Lint on your README](https://tools.aicreditsapi.com/tools/grammar-check) - free 5 checks a day, no signup.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)