RESOLVED FIXED 14350
WordPress: Editor strips paragraph breaks
https://bugs.webkit.org/show_bug.cgi?id=14350
Summary WordPress: Editor strips paragraph breaks
Mayel de Borniol - LeLab.TV
Reported 2007-06-23 19:05:50 PDT
When typing a post in WordPress 2.2.1 with visual editor activated, line breaks appear in the editor, but are stripped out when saving the post or switching to "Code View". This doesn't occur when setting WebKit's UA to Mozilla.
Attachments
Mayel de Borniol - LeLab.TV
Comment 1 2007-06-23 19:17:51 PDT
Oliver Hunt
Comment 2 2007-06-23 19:22:37 PDT
Behaviour changes to be *almost* correct when using the firefox UA. It looks like the switch between code and visual mode is stripping out <p> and <br> elements for some reason. When using firefox UA it looked like it was hiding <br> and <p> in code editing mode, and reinserting them (or something) in visual mode, so something is that logic is probably the cause of the woes.
Mayel de Borniol - LeLab.TV
Comment 3 2007-06-23 19:30:45 PDT
Oliver Hunt's comment makes sense since that's the normal behavior in Firefox : When switching to code editing mode, there are no <p> and <br> (but actual new lines) But when saving the post, there should <p> and <br>
David Kilzer (:ddkilzer)
Comment 4 2007-06-23 23:04:28 PDT
Should this bug block Bug 6627?
Mayel de Borniol - LeLab.TV
Comment 5 2007-06-24 16:45:04 PDT
David Kilzer : In my opinion, it should. It prevents the WP editor from being usable.
Justin Garcia
Comment 6 2007-06-24 20:17:39 PDT
> Should this bug block Bug 6627? TinyMCE's advanced editor's "Show Source" feature doesn't have this problem, so no, since this seems to be specific to WordPress. Nevertheless, this bug is real serious, and so we should try to get it addressed asap.
Justin Garcia
Comment 7 2007-08-01 15:58:58 PDT
<rdar://problem/5368629> WordPress: Editor strips paragraph breaks
Justin Garcia
Comment 8 2007-08-01 17:13:11 PDT
Looks like the textarea that WordPress uses to submit contains (as children) text nodes and brs: TEXTAREA 0x1779c6c0 CLASS=mceEditor STYLE=display: none; #text 0x187be120 "foo" BR 0x187be150 BR 0x187be1c0 #text 0x187be260 "bar" BR 0x187be290 BR 0x187be300 #text 0x187be3a0 "baz" But the value() of the textarea is "foobarbaz". I made this reduction: <script> function foo() { textarea = document.getElementById("textarea"); textarea.appendChild(document.createTextNode("foo")); textarea.appendChild(document.createElement("br")); textarea.appendChild(document.createTextNode("bar")); } function bar() { alert(textarea.value); } </script> <textarea id="textarea"></textarea> <input type="button" onclick="foo();"> <input type="button" onclick="bar();"> And it behaves the same way in FF. I don't think this is the right way to submit the content of the editable region. This seems like a WordPress bug.
David Kilzer (:ddkilzer)
Comment 10 2007-08-02 06:48:42 PDT
Moving to Evangelism per Comment #8 and Comment #9.
Justin Garcia
Comment 11 2008-03-21 00:37:24 PDT
Apparently this is fixed in WordPress 2.5, which is set to be released shortly: http://trac.wordpress.org/ticket/4521 http://blog.wired.com/monkeybites/2008/03/catch-a-sneak-p.html
Justin Garcia
Comment 12 2008-04-18 14:20:52 PDT
Looks like 2.5 was deployed at wordpress.com. I can no longer reproduce this.
Note You need to log in before you can comment on or make changes to this bug.