Skip to content

fix: remove Vale BlockIgnores that broke code block scoping - #2839

Open
honzajavorek wants to merge 1 commit into
masterfrom
honzajavorek/fix-code-block-scoping
Open

fix: remove Vale BlockIgnores that broke code block scoping#2839
honzajavorek wants to merge 1 commit into
masterfrom
honzajavorek/fix-code-block-scoping

Conversation

@honzajavorek

Copy link
Copy Markdown
Collaborator

Vale skips fenced code blocks and HTML comments natively when parsing Markdown, so this BlockIgnores line is (now?) redundant. Because BlockIgnores blanks out matched regions before the Markdown parser sees them, the naive (?s)(```.*?```) pattern desynchronizes Vale's position mapping.

The result is both phantom alerts inside code blocks and real alerts being dropped. Reproduced on
sources/academy/tutorials/apify_scrapers/cheerio_scraper.md, where a probe rule reported a hit at 146:15 - inside the fenced block spanning lines 133-153 - while a genuine hit at 156:11 disappeared. Across sources/academy and sources/platform at suggestion level, removing the line drops 247 misplaced alerts and surfaces 378 previously masked ones.

This affects every rule, not one in particular. At the error level that CI enforces, the result is unchanged (10 errors before and after), so this is behavior-neutral for the pipeline today and a correctness fix for local runs and any stricter rules added later.

Vale already skips fenced code blocks and HTML comments natively when
parsing Markdown, so this BlockIgnores line was redundant. Worse, it was
actively harmful: because BlockIgnores blanks out matched regions before
the Markdown parser sees them, the naive `(?s)(```.*?```)` pattern
desynchronized Vale's position mapping.

The result was both phantom alerts inside code blocks and real alerts
being dropped. Reproduced on
sources/academy/tutorials/apify_scrapers/cheerio_scraper.md, where a
probe rule reported a hit at 146:15 - inside the fenced block spanning
lines 133-153 - while a genuine hit at 156:11 disappeared. Across
sources/academy and sources/platform at suggestion level, removing the
line drops 247 misplaced alerts and surfaces 378 previously masked ones.

This affected every rule, not one in particular. At the error level that
CI enforces, the result is unchanged (10 errors before and after), so
this is behavior-neutral for the pipeline today and a correctness fix for
local runs and any stricter rules added later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@honzajavorek honzajavorek added the t-docs Issues owned by technical writing team. label Jul 31, 2026
@apify-service-account

apify-service-account commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✅ Preview for this PR (commit 8c03fff) is ready at https://pr-2839.preview.docs.apify.com (see action run).

@honzajavorek
honzajavorek marked this pull request as ready for review July 31, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-docs Issues owned by technical writing team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants