How to markdown formatting for cleaner prs
- Step 1Grab the doc from the branch — Copy the Markdown from the PR branch, or download the changed
.mdand have it ready to drop. - Step 2Open the prettifier — Go to /markdown-tools/md-prettifier. Processing is browser-side, so the contributor's draft never leaves your machine.
- Step 3Paste or drop the file — Paste the source or drop one
.mdfile (free tier: up to 1 MB / 500,000 characters). - Step 4Decide on wrap width — Leave the Wrap width dropdown on
No wrapto keep diffs minimal, or pick80/100/120 colsif your team's convention is fixed-width source for predictable line-level diffs. - Step 5Run and review the diff — Click Run, then diff the output against the original. The only changes should be trimmed trailing spaces, normalised heading spacing, and collapsed blank lines.
- Step 6Commit the formatting pass separately — Commit the prettified file as its own whitespace-only commit (e.g.
style(docs): prettify markdown) so reviewers can skip straight to the content commits.
PR-noise sources the prettifier removes
Each row is a common reason a docs diff looks bigger than the actual change.
| Diff noise | How it shows up in review | Prettifier action |
|---|---|---|
| Trailing whitespace | Red ···· blocks at end of lines on GitHub; markdownlint MD009 | Trimmed from every prose line (outside code fences) |
| Heading with no surrounding blank lines | Editing the heading pulls the paragraph above/below into the hunk | Inserts one blank line before and after each ATX heading |
| Inconsistent blank-line gaps | Whole sections re-indent vertically when one author saves | Collapses 3+ blank lines to a single blank line |
| Leading blank lines in the file | Dead space at top shows as an unrelated diff hunk | Stripped from the body (frontmatter kept intact) |
| Unwrapped giant paragraph | A one-word edit re-marks the entire paragraph as changed | Optional 80/100/120 wrap gives stable line boundaries |
| Reworded sentence (real change) | The thing reviewers actually want to see | Untouched — content is preserved, so it stands out clearly |
Wrap-width choices for diff stability
Fixed-width source keeps future edits to a single line. The wrap skips code, lists, tables, and headings.
| Choice | wrapWidth | Good for | Trade-off |
|---|---|---|---|
| No wrap (default) | 0 | Teams whose renderer soft-wraps; smallest reformat commit | A one-word edit can re-mark a long line as changed |
| 80 cols | 80 | Terminal reviewers; classic 80-column house style | More lines in the file |
| 100 cols | 100 | Balanced width for wide editors | Slightly longer lines |
| 120 cols | 120 | Modern wide-screen editors | Long lines still wrap visually in narrow panes |
Cookbook
Diff-shaped before/after pairs. The point of each: shrink the noise so the real change is obvious.
Trailing spaces that GitHub paints red
The classic PR distraction. These lines look unchanged but the diff highlights trailing whitespace. Prettifying trims them so the next content change is the only thing that shows. (Trailing spaces shown as ·.)
Before (as committed): Setup instructions are below.··· Run the installer.·· After (prettified): Setup instructions are below. Run the installer.
Heading edit no longer drags neighbours into the hunk
Without surrounding blank lines, editing a heading expands the diff to the lines above and below. Normalised spacing isolates the heading on its own.
Before: The API is stable. ## Authentication Use a bearer token. After: The API is stable. ## Authentication Use a bearer token.
Whitespace-only commit, content untouched
Run the prettifier and the diff is purely spacing — no sentence, link, or code line changes. Reviewers can approve it without reading prose.
Before: # Release Notes We shipped v2. After: # Release Notes We shipped v2. (Only blank-line collapse applied; the heading text — including its double space after '#' — is preserved verbatim.)
Fixed-width wrap for minimal future diffs
Wrapping prose at 80 cols means a later edit to one sentence changes one line, not the whole paragraph. Choose 80 cols before committing.
Wrap width: 80 cols Before (one line): This section explains the rollback procedure and the on-call escalation path for production incidents. After: This section explains the rollback procedure and the on-call escalation path for production incidents.
Code samples in the doc stay byte-for-byte
Reviewers trust that a formatting commit didn't quietly change a code example. The prettifier never touches fenced-block contents.
Before: ## Usage ```bash npm run build npm test ``` That's it. After: ## Usage ```bash npm run build npm test ``` That's it.
Edge cases and what actually happens
Prettifying produces a large whitespace diff on first run
Expected (one-time)If a doc has never been formatted, the first prettify can touch many lines. Land it as a standalone commit so subsequent PRs stay clean; reviewers approve the one-time pass and future diffs are small.
Two-space hard breaks in the source get removed
RemovedTrailing-whitespace trimming strips CommonMark two-space hard breaks. If a contributor relied on them, the rendered line breaks change. Prefer a trailing backslash (\) for breaks that survive prettifying — flag this in review.
List indentation is left as the contributor wrote it
By designThe prettifier does not re-indent lists, so an inconsistently nested list still looks inconsistent in the source. If list hygiene matters for the PR, run the list fixer as a separate step.
Trailing whitespace inside a code block in the doc
PreservedOnly prose lines are trimmed. Trailing spaces inside fences (e.g. a shell example) are kept, so the code sample in the PR is unchanged.
Setext (underline-style) headings are not spaced
By designOnly ATX (#) headings get blank lines added. A Setext heading underlined with ===/--- is treated as prose and stays as-is — convert to ATX if you want consistent heading spacing across the PR.
Frontmatter present in a docs page
PreservedYAML/TOML frontmatter (common in static-site docs) is split off and re-attached verbatim. The reformat won't show up as a diff in the metadata block.
Whole reformat plus content change in one commit
AvoidMixing a prettify pass with a content edit in one commit reintroduces the noise problem. Keep formatting and content in separate commits so the review stays clean.
No trailing newline in the output
ExpectedThe output ends on the last content character; no final newline is appended. If your repo enforces a trailing newline (e.g. EditorConfig insert_final_newline), add it before committing or let your linter fix it.
File over the free-tier cap on a large monorepo doc
413 / blocked on freeFree is 1 MB / 500,000 chars per file. Big generated docs need Pro (10 MB / 5,000,000 chars) or higher. The character cap is independent of byte size.
Inline HTML in the doc (e.g. <details> blocks)
PreservedHTML tags are treated as prose lines: trailing whitespace trimmed, blank-line rules applied around adjacent headings, but the tags themselves are never altered or removed.
Frequently asked questions
Why do my docs PRs have red blocks in the diff?
Those are trailing-whitespace markers. GitHub highlights spaces at end of line. Prettifying trims them on every prose line, so they disappear from the diff and from markdownlint MD009.
Will the prettifier change any of the actual text?
No. Words, links, emphasis, lists, and fenced code blocks are byte-identical after a run. Only trailing whitespace and blank-line spacing change, which is what makes it safe as a standalone formatting commit.
Should I commit formatting separately from content?
Yes. A pure-whitespace prettify commit is trivial to review; mixing it with content edits reintroduces the noise. Keep them in separate commits.
Does it normalise list indentation in a PR?
No. List indentation and markers are left as written. Use the list fixer if a PR needs list hygiene.
What wrap widths are available?
The dropdown offers No wrap (default), 80, 100, and 120 cols. Fixed-width source keeps future edits to a single line for cleaner diffs.
Does wrapping break code blocks in the doc?
No. Wrapping applies to prose only and skips code fences, list items, table rows, and headings, so code samples are never re-flowed.
Can every contributor run the same formatting?
Yes — it's deterministic, so any contributor pasting the same file gets the same output. Agreeing on one wrap width (or No wrap) team-wide keeps everyone's diffs consistent.
Will it conflict with markdownlint in CI?
It's complementary. Prettifying clears MD009 (trailing spaces) and helps with blank-line rules; run the linter afterward for deeper rule checks.
Does the doc get uploaded for processing?
No. It runs in your browser, so a contributor's branch content stays on your machine. Only an anonymous processed-file counter is recorded for signed-in stats.
How big a doc can I prettify on the free tier?
Up to 1 MB or 500,000 characters per file. Larger docs need Pro (10 MB / 5,000,000 chars), Pro-media (50 MB / 20,000,000), or Developer (500 MB / unlimited).
Can I wire this into a pre-commit hook?
The web tool is interactive. For automation, the tool's GET endpoint returns its schema, and execution is runner-backed via @jadapps/runner, which runs the transform in-process locally so files never touch JAD servers.
My PR added a GFM table — will prettifying align it?
No, table alignment isn't part of this tool — table rows are skipped by both the spacing and wrap passes. To fix or align a broken table, use table repair.
Privacy first
All Markdown processing runs locally in your browser using JavaScript. No file is ever uploaded to JAD Apps servers — only metadata counters are saved for signed-in dashboard stats.