Skip to content

fix(rules): content/reading-level skips code blocks (repo#1639) - #1931

Merged
nc9 merged 1 commit into
mainfrom
boat/code-blocks-content-rules-1639
Nov 16, 2026
Merged

nc9 merged 1 commit into
mainfrom
boat/code-blocks-content-rules-1639

Conversation

@nc9

@nc9 nc9 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Measures the three rules that shared getTextExcludingScripts (private issue squirrelscan/repo#1639).

  • content/reading-level: DISTORTED. A large
     (400 unpunctuated lines) changed the grade level and avg sentence length versus the prose-only page (test fails on main with received 5 vs expected 0). Now reads getProseTextExcludingCode.
  • content/keyword-stuffing: not affected. It already reads getRenderedProseTextWhere, which skips code subtrees. Left unchanged; pinned by a test (identifier repeated in

    is flagged, in

     is not).
  • content/hidden-text: left unchanged. It uses the text only as a length measure of a subtree that is already hidden; hidden code is still hidden content and counting it is the correct conservative behaviour.

Tests: reading-level-code-blocks-1639, content-no-dom-mutation, page-features-reading-level: 10 pass. Rules typecheck and lint pass. No new rule, so no README/docs count changes. The squirrelscan agent skill needs no change.

@nc9
nc9 marked this pull request as ready for review November 16, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant