Skip to content

Read Table Cells From the Parser in the Semicolon Rule #3655

Closed

Description

@ptr727

Summary

rule_semicolon in .github/actions/prose-gate/prose_lint.py finds a table row's cells by splitting the raw line on |. An escaped \| inside one cell therefore splits that cell in two. A comma before the \| then no longer excuses a semicolon list after it, so the rule reports semicolons that the whole cell would allow.

The sentence-length rule reads cells from markdown-it-py's th_open and td_open inline tokens, so the gate now reads cells two ways. Moving rule_semicolon onto the parsed cells would close this case and leave one cell reader.

Repro

printf '# Probe\n\n| A | B |\n| --- | --- |\n| x | red, green \\| blue; cyan; teal |\n' > probe.md
python3 scripts/prose_lint.py --check semicolon probe.md

Expected: no violation, since the cell is one semicolon list that carries a comma. Actual: two semicolon violations at probe.md:5.

Done

The semicolon rule judges each parsed table cell whole, an escaped pipe included, and a test covers the case.

Found by a local review pass on #3654.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions