[wp-trac] [WordPress Trac] #60287: HTML API: P end tag does not generate P element
WordPress Trac
noreply at wordpress.org
Thu Jan 18 18:53:25 UTC 2024
#60287: HTML API: P end tag does not generate P element
--------------------------------------+------------------------------
Reporter: jonsurrell | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTML API | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------------
Comment (by dmsnell):
thanks @jonsurrell. this so-far hasn't been considered an error, but it
raises the question noted in the roadmap for 6.5, which is to ask what to
do when a tag implies changes to the document before the cursor. we're
aware that there's a P element here, but we don't have a proper way to
represent it yet.
if it weren't mostly benign I would have aborted when reaching an
unexpected P tag closer, but there's not P tag opener to stop at, and the
HTML Processor doesn't stop at tag closers, so it's not wrong either what
it's doing, from one sense. it's not possible to target this P element to
change it, and CSS selectors may not find the right thing, but the
breadcrumbs should remain accurate in the presence of these unexpected
closers.
We can probably handle this in a similar way that we have discussed
handling a closing `</br>`, and add special-casing to note it and modify
the document if it's modified.
until then, if you think it's important enough we can abort processing.
I'm reluctant to do that because we do properly handle this the way the
spec reads, we just don't stop on the implicitly-created `P` element to
let people modify it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60287#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list