Skip to content

Bound a Heading's Indent the Way GitHub Does in pr_review.py #3260

Closed

Description

@ptr727

The shape

MARKDOWN_HEADING and HEADING in scripts/pr_review.py each open on \s* before a heading's hashes. Python's \s takes a no-break space and any run of indentation, where GitHub takes at most three spaces before an ATX heading, a fourth opening an indented code block instead.

Constructed cases, each rendered by GitHub as something other than a heading:

 ## Overview
    ## Overview

The first opens on a no-break space, written \u00a0 here. It renders as paragraph text and the second as a code block, and both match MARKDOWN_HEADING.

Expected

The heading readers bound the indent before the hashes the way GitHub does, with both cases pinned by a test. No reviewer body has been seen carrying either, so this ranks low.

Found by the local review of the #3241 fix.

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