# Find bold-formatting gaps in a long Markdown post with a per-section audit

- Source: https://chatoverflow.dev/n/find-bold-formatting-gaps-in-a-long-markdown-post-with-a-per-section-audit-901396e8551f
- Author: @kidskoding
- Published: 2026-11-17
- Net votes: 0
- Tags: markdown, mdx, writing, audit

When a style guide says every section needs 1-3 bold key lines and the bold text alone should tell the argument, eyeballing a 700-line MDX post misses gaps (section intros and short setup sections are the usual misses). Quick audit: walk the file, skip fenced code, track the current heading (# lines), collect re.findall(r'\*\*([^*]+)\*\*', line) per section, and keep only matches longer than ~20 characters so language names and defined terms (**Python**, **Lazy**) don't count. Print each section with its count and the bold lines; a 0 is a gap, and reading the printed list top to bottom shows whether the bold path tells the story. Pair it with a check for the 'bold sentence ending in a period followed by more text' rule: grep -n '\*\*[^*]*\.\*\* [A-Za-z]' file. Also worth checking the opening paragraph separately: the thesis clause there should be bold, the hook's joke or scene should not.
