#6870 closed defect (bug) (fixed)
Nest Q[uotation] elements mishandled by preprocessor, possibly trashing entry.
Reported by: | oeconomist | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 2.5.1 |
Component: | Formatting | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In HTML, one is allowed to nest Q[uotation] elements within Q[uotation] element. The WordPress editor sees nested quotation elements as in error, and attempts to fix things by closing the outer element when it reaches the inner element. I note also that a spurious DIV-closing tag may be placed at the end of an entry containing nested Q[uotation] elements, causing the rest of the 'blog page to be rendered incorrectly. Users are forced either to forgo best HTML practice, or to bypass the WordPress editor to fix the entry.
(Bug was also found in Version 2.5.)
Attachments (1)
Change History (23)
#1
@
16 years ago
- Keywords wpautop added; Q[uotation] element removed
- Milestone changed from 2.7 to 2.9
#4
@
14 years ago
- Keywords posting editor wpautop removed
- Resolution set to worksforme
- Status changed from new to closed
#5
@
14 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
Assuming this ticket is referring to nested blockquote elements -
I believe it was refering to the inline variant, the <q>..</q>
Quotation element, can you re-test with that one too?
#6
@
14 years ago
Tested with nested inline quote tags as below and that also works fine:
<q>This is a quotation that quotes <q>another quotation</q> inside it.</q>
#7
@
14 years ago
- Resolution set to worksforme
- Status changed from reopened to closed
Feel free to reopen if there is an issue.
#8
@
14 years ago
- Milestone Future Release deleted
most likely fixed with one of the many formatting updated over the versions. thanks for testing :)
#9
@
13 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
It is still broken on WordPress 3.1.3 running on my host. If it's fixed in some forthcoming version, that's cool. It the test was run on 3.1.3, then the reason for different behaviors needs to be explored.
#10
@
13 years ago
- Keywords reporter-feedback added
I tested using the code in comment:6, and it works fine in 3.1.3. Please post a code snippet that breaks for you.
Note that inserting line breaks in between the tags will cause problems with wpautop - but that is a wider autop issue that affects all inline tags.
#11
follow-up:
↓ 12
@
13 years ago
solarissmoke—
The very string that you present above
<q>This is a quotation that quotes <q>another quotation</q> inside it.</q>
breaks for me.
Is it possible that your inline-quote plugin causes your installation to handle nested quotations correctly, while a bare installation will not?
#12
in reply to:
↑ 11
@
13 years ago
Replying to oeconomist:
Is it possible that your inline-quote plugin causes your installation to handle nested quotations correctly, while a bare installation will not?
Nope, I'm testing on a fresh checkout of 3.1.3 with no plugins installed :). What is that string being converted to in your output html?
#13
@
13 years ago
A post with nothing but that string entered becomes
<p><q>This is a quotation that quotes </q><q>another quotation</q> inside it.</p>
which is then unsurprisingly rendered as
“This is a quotation that quotes ”“another quotation” inside it.
In other words, just as originally reported, the outer quotation is closed when the inner quotation is encountered.
#14
@
13 years ago
- Keywords reporter-feedback removed
Ah, found the problem. It's with balance_tags
.
#18
@
13 years ago
+1
I was responsible for the introduction of the self-nesting tag handling in balance_tags()
. The omission of the <q>
tag was an oversight (for the life of me I can't find where I added a patch to rectify that lo those many years ago). Anyhow, the change is trivial and has no negative side effects.
As further proof as to whether the <q>
tag is self-nestable, the W3C itself does so in an example in the HTML 4.01 spec section pertaining to <q>
here.
#19
@
13 years ago
- Keywords commit needs-unit-tests added
- Milestone changed from Future Release to 3.3
#21
@
13 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from reopened to closed
In [18585]:
Assuming this ticket is referring to nested
blockquote
elements - it seems to work fine in trunk, wpautop doesn't mess them up.