Skip to content

Strip an Attributed Details or Summary Opener Through TAGS in pr_review.py #3208

Closed

Description

@ptr727

The shape

scripts/pr_review.py strips presentation tags from a printed block through TAGS, </?(?:details|summary)>, which unwrap and entry_heading both use. It matches a bare tag only, so an attributed opener such as <details open> or <summary class="x">, or a self-closed <summary/>, survives unwrap and prints raw in the digest. entry_heading likewise reads such a heading with its tag still on it.

The opener readers moved onto one boundary, tag_opener, in #3206. TAGS is the one opener reader left on a rule of its own. It was left out there because it is a stripper rather than a recognizer, and building it as tag_opener(...) plus [^>]*> would let a tag left open at a line's end swallow the prose after it.

Expected

TAGS strips an attributed or self-closed <details> or <summary> opener as it strips a bare one, ending the tag name where tag_opener does, and bounded so an unclosed tag strips nothing past its own line. A test pins <details open>, <summary class="x">, and <summary/> as stripped by unwrap, and <summaryx> as kept.

Found by the local review of #3206.

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

    enhancementNew feature or requestscriptA defect in hub tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions