Skip to content

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

Merged
honzajavorek merged 1 commit into
masterfrom
honzajavorek/fix-code-block-scoping
Aug 4, 2026
Merged

fix: remove Vale BlockIgnores that broke code block scoping#2839
honzajavorek merged 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 was deleted.

@honzajavorek
honzajavorek marked this pull request as ready for review July 31, 2026 15:49
@honzajavorek
honzajavorek requested a review from TC-MO August 4, 2026 16:18
@TC-MO

TC-MO commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

I remember there was a reason why I added it but i do not remember why actually now :D I feel like it was to fix some other bug ¯_(ツ)_/¯ worst case scenario it'll surface again and we will think some more. (vale is pretty finicky)

@TC-MO TC-MO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the worst thing that can happen :D

@honzajavorek
honzajavorek merged commit 27ba88f into master Aug 4, 2026
16 checks passed
@honzajavorek
honzajavorek deleted the honzajavorek/fix-code-block-scoping branch August 4, 2026 16:57
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.

3 participants