Skip to content

End a Code Span at an HTML Block Line in pr_review.py #3214

Closed

Description

@ptr727

The shape

CODE_SPAN in scripts/pr_review.py ends an inline code span only at a blank line. GitHub also ends a paragraph at a line that opens an HTML block, such as </details> or <details>, so a backtick never pairs across one there.

So one unpaired backtick in a finding's last paragraph pairs with the first backtick of the next entry's summary, and everything between them reads as quoted. Constructed case, inside a previously-missed section:

Quote the ` character.
</details>
<details>
<summary>Low severity Rename `x` here</summary>

unwrap now masks code spans before it strips the wrapper tags, which keeps a tag a finding quotes in code (#3213). So here the </details>, <details>, and <summary> between the two backticks print raw in the digest. No finding text is lost, but every reader that masks through CODE_SPAN takes the same wrong span.

Expected

A code span does not cross a line that opens an HTML block, as GitHub renders it, with a test pinning the constructed case above as stripped by unwrap.

Found by the local review of #3213.

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