You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read a Paragraph-Ending Line Within Its Container in pr_review.py's CODE_SPAN #3240
CODE_SPAN in scripts/pr_review.py reads a paragraph-ending line from that line alone, bounded to three columns of indent. GitHub reads it relative to the container the paragraph sits in, so two cases still differ from the renderer.
A nested list item indented four or more columns ends its parent item's paragraph, and the span still pairs across it:
- a `b
- c` d
GitHub renders a nested <li>c d` with the first tick unpaired. The regex masks the nested item.
A setext underline ends a paragraph at the top level and is lazy text under a list item or a quotation. The span pairs across it in both places, which is right in a container and wrong at the top level:
a `b
===
c` d
GitHub renders a b` as a heading. The regex pairs the ticks across it.
Both were left as limits in the #3227 change, since a line reader cannot know its container. The top-level setext case pairing is the behavior before that change too.
Expected
The span boundary knows the container depth of the paragraph it is in, or the limit is documented beside INTERRUPTS_PARAGRAPH and pinned by a test in each direction.
One more case in the same class, found by the local review of the #3236 fix. A tag line inside a list item is measured against an absolute three-space bound, rather than against the item's content column:
- item `a
<div>
b` c
GitHub opens an HTML block at <div>, since it sits two columns past the item's content, and renders no code span. CODE_SPAN.search pairs across the line and masks the <div>. The prose gate measures this bound from the open paragraph's item content column as of #3236, so the two tools now disagree here.
A third case, raised by Copilot's review of promotion #3245. The quoted block-start prefix in CODE_SPAN, {0,3}>(?: {0,4}>)* {0,4}, measures the gap after a quote marker in spaces only:
> a `b
> - c` d
The gap after the second > is a tab. GitHub expands it to the next tab stop, so the list item sits two columns into the quotation and ends the paragraph, and it renders no code span. CODE_SPAN.search pairs across the line. The same holds where the paragraph is not quoted. A tab's width depends on the column it starts at, so this belongs with the container reading above rather than with another spelling of the gap.
A fourth case, the same container gap: a sibling list item numbered other than 1 ends the item's paragraph above it, but PARAGRAPH_BREAK only ends one at an ordered item numbered 1, which is the rule for a paragraph outside a list.
1. a `b
2. c` d
GitHub renders two items and no span. CODE_SPAN pairs the two backticks across the items.
The fix for #3235 reads inline HTML on the same PARAGRAPH_BREAK, so an unclosed opener carries the gap too:
1. a <!-- b
2. c `x` -->
GitHub renders x as a span in item 2. The reader runs the comment across the items to the later -->, so it finds no span there.
Activity
End a Code Span at Every Paragraph-Ending Line in pr_review.py (#3242)
ptr727 commentedon Oct 19, 2026
One more case in the same class, found by the local review of the #3236 fix. A tag line inside a list item is measured against an absolute three-space bound, rather than against the item's content column:
GitHub opens an HTML block at
<div>, since it sits two columns past the item's content, and renders no code span.CODE_SPAN.searchpairs across the line and masks the<div>. The prose gate measures this bound from the open paragraph's item content column as of #3236, so the two tools now disagree here.Bound a Paragraph-Interrupting Tag Line's Indent by Its Container in …
ptr727 commentedon Oct 19, 2026
A third case, raised by Copilot's review of promotion #3245. The quoted block-start prefix in
CODE_SPAN,{0,3}>(?: {0,4}>)* {0,4}, measures the gap after a quote marker in spaces only:The gap after the second
>is a tab. GitHub expands it to the next tab stop, so the list item sits two columns into the quotation and ends the paragraph, and it renders no code span.CODE_SPAN.searchpairs across the line. The same holds where the paragraph is not quoted. A tab's width depends on the column it starts at, so this belongs with the container reading above rather than with another spelling of the gap.ptr727 commentedon Oct 20, 2026
A fourth case, the same container gap: a sibling list item numbered other than 1 ends the item's paragraph above it, but
PARAGRAPH_BREAKonly ends one at an ordered item numbered 1, which is the rule for a paragraph outside a list.GitHub renders two items and no span.
CODE_SPANpairs the two backticks across the items.The fix for #3235 reads inline HTML on the same
PARAGRAPH_BREAK, so an unclosed opener carries the gap too:GitHub renders
xas a span in item 2. The reader runs the comment across the items to the later-->, so it finds no span there.Read Code Spans, Inline HTML, and Autolinks Left to Right in pr_revie…
Pin pr_review.py's Markdown Reader Gaps as Known Limits (#3270)
Promote the Markdown Reader Known Limits and File-Naming Dot Scope to…