Skip to content

Open No Code Span at a Backtick Inside an HTML Comment or Autolink in pr_review.py #3235

Closed

Description

@ptr727

The shape

CODE_SPAN in scripts/pr_review.py opens a code span at any backtick run. In GFM, an HTML comment or an autolink that starts first keeps a backtick inside it literal, so that backtick opens nothing.

Constructed case:

<!-- a ` b --> <b>Open (2)</b> `x`

GFM renders <b>Open (2)</b> as live bold. mask_quotations pairs the comment's backtick with the one before x, so the <b> reads as quoted. Since #3215, unwrap then prints the tag raw. An autolink holding a backtick, <https://e.example/a>`, behaves the same way.

The same over-match has always shaped unwrap's TAGS drop and every vetting reader, since they all mask through CODE_SPAN. #3215 only routed emphasis and badges through it as well.

Expected

A backtick inside an HTML comment or autolink that opened earlier on the line opens no span, with the constructed case pinned by a test. No reviewer body has been seen carrying this shape, so it ranks below #3227.

Found by the local review of the #3215 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