Opened 18 years ago
Closed 18 years ago
#3621 closed defect (bug) (fixed)
wpautop() should not break up script and object tags
Reported by: | Viper007Bond | Owned by: | |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
Make a post with this:
Test<object><param name="text" value="test" /></object>test
Results in this:
<p>Test<br /> <object> <param name="text" value="test" /></object> <p>test</p>
The <br />
probably shouldn't be there, there shouldn't be a line break after the <object>
, and most importantly, there's a missing </p>
.
Attachments (1)
Change History (15)
#2
@
18 years ago
Er...
<p>Test</p> <p><span>Test</span><br /> <script type="text/javascript">/* Test */</script> <p>Test</p>
#5
@
18 years ago
- Summary changed from More fun with wpautop() to wpautop() should not break up script and object tags
#6
@
18 years ago
New output with wpautop_dont_break_script_object.patch:
In:
Test<object><param name="text" value="test" /></object>test
Out:
<p>Test<object> <param name="text" value="test" /></object>test</p>
#8
in reply to:
↑ 7
@
18 years ago
I had trouble with broken object tags in 2.1.2, too.
I fixed this in another way that at least worked with
raw posts from phpMyAdmin.
I changed line 75 of formatting.php from
$pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
to
$pee = preg_replace('/<(object|script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
I have no idea what that code actually is doing - just though I should share this.
Would be great if you could save me patching this in future releases.
#10
@
18 years ago
It would be nice if we could get dllmain's patch into 2.2 for another reason. That bit of code prevents it from converting newlines into BR's inside script and style blocks. By adding object blocks to that, it would eliminate a lot of the issues people have with pasting in the object codes given out from sites like youtube and such.
#11
@
18 years ago
- Milestone changed from 2.3 to 2.2
Otto42, do you currently run with this patch installed? I will install it now on my live blog as well.
Another example: