Last modified: 2012-10-03 21:17:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41545, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39545 - Comments break splitting of paragraphs
Comments break splitting of paragraphs
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-21 23:56 UTC by Roan Kattouw
Modified: 2012-10-03 21:17 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2012-08-21 23:56:17 UTC
See http://parsoid.wmflabs.org/_rt/mw/VisualEditor:Test , and note how "many of your questions" and "Note: The Edit button" are on the same line, while they're really supposed to be in separate paragraphs.

Basically, what's going on here is that the wikitext:

Foo
<!-- Comment -->

Bar

is turned into this HTML:
<p>Foo
<!-- Comment -->

Bar</p>

while really the correct output is this:
<p>Foo</p>
<!-- Comment -->

<p>Bar</p>

This results in the page rendering as "Foo Bar" rather than "Foo [paragraph break] Bar", and of course that means the way the editor renders it and lets you edit it is wrong as well.

What's maybe even scarier is that this round-trips "correctly", i.e. the wikitext->HTML conversion is wrong, but then the HTML->wikitext conversion is wrong in exactly the reverse way, and that causes it to round-trip. I suspect this is because of the presence of the newlines in the HTML, but that's also a bug: ideally the serializer shouldn't convert a single <p> to wikitext representing multiple paragraphs, regardless of newlines (this is very unlikely to be a practical problem for VE though).
Comment 1 ssastry 2012-09-21 20:46:28 UTC
Fixed in https://gerrit.wikimedia.org/r/#/c/24502/3
Also, added a test to mediawiki/core parserTests.txt

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links