Make WordPress Core

Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#58009 closed enhancement (fixed)

HTML API: Expose self-closing flag in Tag Processor

Reported by: dmsnell's profile dmsnell Owned by: bernhard-reiter's profile Bernhard Reiter
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Introduce has_self_closing_flag() to the HTML Tag Processor, exposing whether a currently-matched tag contains the self-closing flag /, used when determining if one needs to look for a closing tag of the same name.

This enables structural parsing of an HTML document and is needed to identify self-closing HTML foreign elements.

Change History (8)

This ticket was mentioned in PR #4266 on WordPress/wordpress-develop by @dmsnell.


13 months ago
#1

  • Keywords has-patch has-unit-tests added

Introduce has_self_closing_flag() to the HTML Tag Processor, exposing whether a currently-matched tag contains the self-closing flag /, used when determining if one needs to look for a closing tag of the same name.

This enables structural parsing of an HTML document and is needed to identify self-closing HTML foreign elements.

Trac ticket #58009

cc: @adamziel @gziolo @ockham

#2 @SergeyBiryukov
13 months ago

  • Component changed from General to HTML API

@zieladam commented on PR #4266:


13 months ago
#3

LGTM! I left two minor notes but nothing big.

#4 @Bernhard Reiter
13 months ago

  • Owner set to Bernhard Reiter
  • Resolution set to fixed
  • Status changed from new to closed

In 55619:

HTML API: Add has_self_closing_flag() to Tag Processor.

In this patch we're adding has_self_closing_flag() to the HTML Tag Processor.
This exposes whether a currently-matched tag contains the self-closing flag /.

This information is critical for the evolution of the HTML API in order
to track and parse HTML structure, specifically, knowing whether an
HTML foreign element is self-closing or not.

Props dmsnell, zieladam.
Fixes #58009.

@Bernhard Reiter commented on PR #4266:


13 months ago
#5

Committed to Core trunk in r55619.

#6 follow-up: @kebbet
13 months ago

Should this ticket be milestoned, instead of Awaiting review? Should this be backported to 6.2.1?

#7 @Bernhard Reiter
13 months ago

  • Milestone changed from Awaiting Review to 6.3

#8 in reply to: ↑ 6 @Bernhard Reiter
13 months ago

Replying to kebbet:

Should this ticket be milestoned, instead of Awaiting review? Should this be backported to 6.2.1?

Thanks for the ping, and apologies for missing this! 6.3 should be fine -- I've now set the milestone accordingly!

Note: See TracTickets for help on using tickets.