Opened 15 years ago
Last modified 5 years ago
#10033 new defect (bug)
wpautop problems with html comments and object tags
Reported by: | Denis-de-Bernardy | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 2.8 |
Component: | Formatting | Keywords: | wpautop needs-unit-tests |
Focuses: | Cc: |
Description
Bumped into this one when upgrading my mediacaster plugin to use swfobject 2.1 (which is not 1.5 compatible), as documented here:
http://code.google.com/p/swfobject/wiki/documentation
I take it I'm not the only one who is going to need to upgrade a plugin. It's minor, since I'll just move the filter further down in the queue, but it's still worth reporting:
<object id="m544cf9700db147f751dc34ea1241d8bd" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="260"> <param name="movie" value="http://www.youtube.com/v/_nkZ3eHeXlc" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/_nkZ3eHeXlc" width="320" height="260"> <!--<![endif]--> <p><a href="http://www.macromedia.com/go/getflashplayer">Get Flash 9.0</a> to see this player.</p> <!--[if !IE]>--> </object> <!--<![endif]--> </object> <script type="text/javascript"> //swfobject.registerObject("m544cf9700db147f751dc34ea1241d8bd", "9.0.0"); </script>
Gets turned into the following mess:
<object id="m544cf9700db147f751dc34ea1241d8bd" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="260"><param name="movie" value="http://www.youtube.com/v/_nkZ3eHeXlc" /><!--[if !IE]>–><br /> <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/_nkZ3eHeXlc" width="320" height="260"><br /> <!--<![endif]--></p> <p><a href="http://www.macromedia.com/go/getflashplayer">Get Flash 9.0</a> to see this player.</p> <p><!--[if !IE]>–><br /> </object><br /> <!--<![endif]--><br /> </object><br /> <script type="text/javascript"> //swfobject.registerObject("m544cf9700db147f751dc34ea1241d8bd", "9.0.0"); </script>
So, two/three issues:
- wpautop should also ignore double object tags, and html comments
- wptexturize should ignore html comments
Change History (14)
#2
@
15 years ago
- Keywords needs-patch added
Bumpy bump! I'd greatly appreciate this being fixed as I'm moving my video plugin over to using this type of embedding.
Not sure if I'm good enough with regex to make a patch myself though.
#6
follow-up:
↓ 13
@
14 years ago
For wpautop the fix is to ensure that there aren't any line breaks inside the <object>
tag. There is a regex in it that tries to remove them (in both the php and JS versions) but it is not HTML comments aware.
The above example breaks because the IE conditionals are on new lines. We could add yet another regex to specifically check for HTML comments but it's generally better for plugins to remove any line breaks from complex <object>
blocks when inserting them before wpautop (this is true for all complex HTML blocks too). The objects inserted by WordPress work properly.
#8
follow-up:
↓ 9
@
14 years ago
- Cc norbert@… added
The wptexturize part will be fixed to skip HTML tags in #4539.
#12
@
10 years ago
- Keywords wptexturize removed
- Summary changed from wptexturize and wpautop problems with html comments and object tags to wpautop problems with html comments and object tags
See #8912 for wptexturize.
No patch. Does someone want to take a look at this for WP 3.0?