Skip to content

Bound the Indent of a Paragraph-Interrupting Tag Line in prose_lint.py #3236

Closed

Description

@ptr727

The shape

OPENING_TAG in .github/actions/prose-gate/prose_lint.py opens on ^\s*, so a block tag indented any distance ends the paragraph above it. CommonMark allows a block start at most three spaces of indent past its container. A tag indented four or more spaces after a paragraph line is lazy continuation text, so the paragraph goes on.

Constructed case:

para
    <div>
*x*

GitHub's renderer, asked through gh api markdown -f mode=gfm, keeps all three lines in one paragraph, rendering *x* as <em>x</em>. prose_lint.py ends the paragraph at the <div> line, so the sentence-length check measures two short sentences where GitHub shows one.

pr_review.py's CODE_SPAN already caps the indent at three spaces through {0,3}.

Expected

The indent a block tag may sit at is bounded relative to its container, so a list item's nested HTML still counts, with the four-space constructed case pinned by a test.

Found by the local review of the #3228 fix.

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