Page MenuHomePhabricator

Line breaks are removed when previewed or saved
Closed, ResolvedPublic

Description

Author: nkomura

Description:
Line breaks are ignored when previewed or saved. The problem was reported in the code commit note.

http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61991

The problem was reproduced in FF3 on Ubuntu and FF3.5 on Windows 7.


Version: unspecified
Severity: critical
URL: Production

Details

Reference
bz22401

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 10:51 PM
bzimport set Reference to bz22401.

nkomura wrote:

With Opera 10 and IE8 on Windows 7, single line break is ignored. But the double breaks renders as a single break.

I don't see how r61991 is directly related; maybe stripping the <br> at the end of a <p> should be Firefox-specific as well.

Also, could you tell us whether the line breaks in question were added line breaks or line breaks already present in the article?

nkomura wrote:

For my test cases, added line breaks disappear when the edits are previewed or saved. Existing line breaks are fine. (FF3 Ubuntu 9.04)

This was already resolved in http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62041 but due to some infrastructure issues not pushed out to non-European visitors.

wikibugs wrote:

Wiki_bug_2010-02-09_22401.pdf

Tested link : http://prototype.wikimedia.org/deployment-en/

On following browsers the functionality fails.Check attachment for Firefox related issue

IE7
FireFox 3.6
FireFox 3.5
FireFox 3.0
Safari 4
Chrome 4
IE8
Opera 10

Opera 9.6 function right

Attached:

wikibugs wrote:

(In reply to comment #5)

Created an attachment (id=7089) [details]
Wiki_bug_2010-02-09_22401.pdf

Tested link : http://prototype.wikimedia.org/deployment-en/

On following browsers the functionality fails.Check attachment for Firefox
related issue

IE7
FireFox 3.6
FireFox 3.5
FireFox 3.0
Safari 4
Chrome 4
IE8
Opera 10

Opera 9.6 function right

Therefore reopening the bug

nkomura wrote:

I should have mentioned that single line break is ignored. Please verify double line breaks inserts a line break in preview or save.

wikibugs wrote:

Wiki_bug_2010-02-09_22401_II.pdf

No double line inserts but <pre>...</pre> tag get inserted. Working fine for Opera 9.6 and IE 7 browsers

Attached:

(In reply to comment #8)

Created an attachment (id=7091) [details]
Wiki_bug_2010-02-09_22401_II.pdf

No double line inserts but <pre>...</pre> tag get inserted. Working fine for
Opera 9.6 and IE 7 browsers

The pre tags get inserted because of leading spaces on lines.

wikibugs wrote:

(In reply to comment #9)

(In reply to comment #8)

Created an attachment (id=7091) [details] [details]
Wiki_bug_2010-02-09_22401_II.pdf

No double line inserts but <pre>...</pre> tag get inserted. Working fine for
Opera 9.6 and IE 7 browsers

The pre tags get inserted because of leading spaces on lines.

Does different browsers read the leading spaces and line differently? Shouldn't all the browsers should function the same way? The attachment shows how different browses act.

wikibugs wrote:

Wiki_bug_2010-02-09_22401_III.pdf

Please refer the attachment. Different browsers act different on data preview. When data copy and paste from a word document, Fire Fox add a tag in the editor. This is not shown in any other browser. But when a text copy and past from the wikimedia itself, that tag is not shown in Fire Fox

Attached:

wikibugs wrote:

(In reply to comment #11)

Created an attachment (id=7095) [details]
Wiki_bug_2010-02-09_22401_III.pdf

Please refer the attachment. Different browsers act different on data preview.
When data copy and paste from a word document, Fire Fox add a tag in the
editor. This is not shown in any other browser. But when a text copy and past
from the wikimedia itself, that tag is not shown in Fire Fox

Test Environment : http://prototype.wikimedia.org/deployment-en/
Version :r62215

Resolved in r62258 - when new lines were created while the cursor was at a <br> within the body (on a blank line) the browser would not create <p> encapsulated new lines, but instead use raw text nodes in the body and more <br> tags (the browser just follows whatever is around the cursor) or in even more frustrating cases <div> tags which are not being handled for newline conversion at all. By wrapping <br> tags with <p> tags we ensure the browser always has the right hint, and the browser now properly encloses new lines, no matter where they were created at, with <p> tags.