Skip to content

End a Code Span at Every Paragraph-Ending Block Start in pr_review.py #3227

Closed

Description

@ptr727

The shape

CODE_SPAN in scripts/pr_review.py now ends a span at a blank line or at a line opening an HTML block (#3214). GFM also ends a paragraph at an ATX heading, a bullet or ordered list item, a blockquote marker, and a thematic break, and a span still pairs across each of those.

Constructed cases:

- Quote the ` char
- Rename `x` here

The span runs from the first bullet's tick to the second bullet's first tick, so the second item's text is masked and the trailing x` reads as unquoted.

Quote the ` char
## Suppressed
Rename `x` here

The ## Suppressed heading is masked, so a section heading a reader looks for is read as quoted.

The file already models those block starts for the quoted-coverage reader: STARTS_BLOCK, read in coverage_statements. So two partial models of "a line that ends a paragraph" now sit in one file, one covering bullets, headings, and <!--, the other covering HTML blocks.

Expected

One model of a paragraph-ending line, shared by CODE_SPAN and the quoted-coverage reader, with each block start pinned by a test. Bullets with no blank line between them are a common shape in a bot's review body, so the list item case comes first.

Found by the local review of the #3214 fix.

Activity

  1. added
    enhancement
    script
    on Oct 19, 2026
  2. ptr727 commented on Oct 19, 2026

    @ptr727
    OwnerAuthor

    One more boundary for the shared model to settle: pr_review.py's HTML_BLOCK_START ends a block name at HTML_SPACE, [ \t\n\f\r], through tag_opener. GitHub's renderer starts an HTML block where a vertical tab follows the name. para\n<div\vclass=x>\n*x* renders <p>para</p> and leaves *x* raw, so a block-start reader wants cmark's [ \t\n\v\f\r]. HTML_SPACE stays right for attribute separators inside a tag. The prose gate's OPENING_TAG takes the block-start class as of #3237.

  3. added a commit that references this issue on Oct 20, 2026
    46bf16f
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

    enhancementscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions