[wp-trac] [WordPress Trac] #29913: wptexturize should handle broken HTML consistently
WordPress Trac
noreply at wordpress.org
Fri Oct 10 00:38:41 UTC 2014
#29913: wptexturize should handle broken HTML consistently
--------------------------+-----------------------------
Reporter: kitchin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 1.5
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Spunoff from ticket:29557#comment:93 because it's not that important.
When encountering broken HTML, `wptexturize()` should match web browser
behavior, without getting too complicated. This bug is for:
1. unclosed comments: `<!-- foo ... texturize those dots?`
2. unclosed tags: `<a ... texturize those dots?`
3. valid terrible HTML that WP probably does not need to support: `<div
data-cycle-slides="> .slides">`. It's encouraged by the popular jQuery
Cycle2 plugin, and its examples.
Currently:
1. unclosed comments are handled like a browser: WP thinks it is a
comment, so does not texturize the dots (turn them into `…`).
2. unclosed tags are not considered a tag, so the dots are texturized. A
browser treats it as a tag, by contrast, and we don't normally texturize
inside tags. The browser also hides it since it's a tag, so whatever we do
is hidden. It's not that important, though it could have side effects on
other parsing, plugins, etc.
3. valid terrible HTML is not parsed as a tag by WP. Fully parsing valid
HTML would slow down WP.
Some of this is already covered by unit tests or may be soon.
Fixing (2) to be consistent with (1) would be easy.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29913>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list