Ticket #13200 (closed bug: fixed)
XHTML .html() on <table> & subelements
| Reported by: | anthonyryan1@… | Owned by: | orkel |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.9 |
| Component: | manipulation | Version: | 1.9rc1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
All .html() calls modifying <table> or subelements of it are failing on documents in XHTML mode.
I will provide a test case shortly.
Change History
comment:2 Changed 4 months ago by dmethvin
- Cc orkel added
- Status changed from new to open
Ugh. I am pretty sure this is due to removing the closing tags in .clean(), which is now part of .buildFragment(). I should have thought of that case, but unfortunately we don't yet run the unit tests in XHTML. See #10198.
@orkel can you take a look?
P.S. I hate XHTML.
comment:3 Changed 4 months ago by orkel
- Status changed from open to assigned
- Cc orkel removed
- Component changed from unfiled to manipulation
- Priority changed from undecided to blocker
- Milestone changed from None to 1.9
- Owner set to orkel
comment:4 Changed 4 months ago by dmethvin
Yeah as soon as I saw this ticket I realized why we still needed them. I guess we all hate XHTML! Thanks for the pulls, I'm on a plane and my battery is almost gone so I'll land them, um, when I land.
comment:6 Changed 4 months ago by anthonyryan1
I just feel the need to chime in pro-XHTML.
Leaving out the ending tag in HTML is like never using semicolons in your javascript. While you can do it, it can cause rare but unexpected consequences when misused. As such, it's always preferable to use them as the language intended.
Just my two cents.
comment:7 Changed 4 months ago by Oleg
- Status changed from assigned to closed
- Resolution set to fixed
Fixes #13200 - innerHTML in buildFragment need end tags
Changeset: bf4fce70408b67d1bf628932ec31dafa14eb007c
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Unfortunately I don't believe jsFiddle can provide a proper XHTML document for this test case, so I've hosted it here for time being: https://whatbox.ca/bugs/jq13200
I've tested and got this problem in Firefox 17, Chrome 24 & Opera 12.11.