Last modified: 2013-06-27 22:00:05 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 T52123, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50123 - Parsoid: Serializer inserts odd whitespace eventhough nodes are no longer in DOM
Parsoid: Serializer inserts odd whitespace eventhough nodes are no longer in DOM
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: ssastry
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-24 19:24 UTC by Krinkle
Modified: 2013-06-27 22:00 UTC (History)
3 users (show)

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


Attachments
Screenshot of the problem in the serialization (104.77 KB, image/png)
2013-06-24 19:24 UTC, Krinkle
Details

Description Krinkle 2013-06-24 19:24:58 UTC
Created attachment 12627 [details]
Screenshot of the problem in the serialization

I think this is caused by Parsoid trying to preserver/re-add whitespace when round-tripping.

Steps to reproduce issue:
* Create a page like the default MediaWiki main page:

<<<MW
'''MediaWiki has been successfully installed.'''

Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki sandbox software. 12

== Getting started ==
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]
* [//www.mediawiki.org/wiki/Localisation#Translation_resources Localise MediaWiki for your language]
MW;

* Edit it with VisualEditor
* Put the cursor before "MediaWiki release mailing list" and select back until before the first character of the heading "Getting started".
* Press backspace. You're now left with 2 of 4 items in the list and an empty heading.
* Again, out the cursor before "MediaWiki release mailing list" and delete until you're behind "software. 12". You're now left with "MediaWiki release mailing list" in the paragraph and a list with 1 item.
* Save page -> Review changes (Screenshot attached)

It inserts a lot of new lines.
Comment 1 Gabriel Wicke 2013-06-24 19:59:39 UTC
Subbu, could this be caused by e90e40c26cd8?
Comment 2 Gabriel Wicke 2013-06-24 20:15:21 UTC
Krinkle: Could you provide a dump of VE's input and output DOM?
Comment 3 Krinkle 2013-06-24 21:16:12 UTC
(In reply to comment #2)
> Krinkle: Could you provide a dump of VE's input and output DOM?

Given the steps to reproduce the bug from comment 0, I get the following:

> doc = ve.instances[0].model.documentModel;
> d = ve.createDocumentFromHtml( ve.init.mw.targets[0].originalHtml );
> d2 = ve.dm.converter.getDomFromData( doc.getFullData(), doc.getStore(), doc.getInternalList() );
> copy( d.body.innerHTML );

<p data-parsoid="{&quot;dsr&quot;:[0,48,0,0]}"><b data-parsoid="{&quot;dsr&quot;:[0,48,3,3]}">MediaWiki has been successfully installed.</b></p>

<p data-parsoid="{&quot;dsr&quot;:[50,171,0,0]}">Consult the <a rel="mw:ExtLink" href="//meta.wikimedia.org/wiki/Help:Contents" data-parsoid="{&quot;targetOff&quot;:103,&quot;dsr&quot;:[62,116,41,1]}">User's Guide</a> for information on using the wiki sandbox software. 12</p>

<h2 data-parsoid="{&quot;dsr&quot;:[173,194,2,2]}"> Getting started </h2>
<ul data-parsoid="{&quot;dsr&quot;:[195,535,0,0]}"><li data-parsoid="{&quot;dsr&quot;:[195,281,1,0]}"> <a rel="mw:ExtLink" href="//www.mediawiki.org/wiki/Manual:Configuration_settings" data-parsoid="{&quot;targetOff&quot;:253,&quot;dsr&quot;:[197,281,56,1]}">Configuration settings list</a></li>
<li data-parsoid="{&quot;dsr&quot;:[282,335,1,0]}"> <a rel="mw:ExtLink" href="//www.mediawiki.org/wiki/Manual:FAQ" data-parsoid="{&quot;targetOff&quot;:321,&quot;dsr&quot;:[284,335,37,1]}">MediaWiki FAQ</a></li>
<li data-parsoid="{&quot;dsr&quot;:[336,434,1,0]}"> <a rel="mw:ExtLink" href="https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce" data-parsoid="{&quot;targetOff&quot;:403,&quot;dsr&quot;:[338,434,65,1]}">MediaWiki release mailing list</a></li>
<li data-parsoid="{&quot;dsr&quot;:[435,535,1,0]}"> <a rel="mw:ExtLink" href="//www.mediawiki.org/wiki/Localisation#Translation_resources" data-parsoid="{&quot;targetOff&quot;:498,&quot;dsr&quot;:[437,535,61,1]}">Localise MediaWiki for your language</a></li></ul>

> copy( d2.body.innerHTML );

<p data-parsoid="{&quot;dsr&quot;:[0,48,0,0]}"><b data-parsoid="{&quot;dsr&quot;:[0,48,3,3]}">MediaWiki has been successfully installed.</b></p>

<p data-parsoid="{&quot;dsr&quot;:[50,171,0,0]}">Consult the <a href="//meta.wikimedia.org/wiki/Help:Contents" rel="mw:ExtLink" data-parsoid="{&quot;targetOff&quot;:103,&quot;dsr&quot;:[62,116,41,1]}">User's Guide</a> for information on using the wiki sandbox software. 12<a href="https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce" rel="mw:ExtLink" data-parsoid="{&quot;targetOff&quot;:403,&quot;dsr&quot;:[338,434,65,1]}">MediaWiki release mailing list</a></p><ul data-parsoid="{&quot;dsr&quot;:[195,535,0,0]}"><li data-parsoid="{&quot;dsr&quot;:[435,535,1,0]}"> <a href="//www.mediawiki.org/wiki/Localisation#Translation_resources" rel="mw:ExtLink" data-parsoid="{&quot;targetOff&quot;:498,&quot;dsr&quot;:[437,535,61,1]}">Localise MediaWiki for your language</a></li></ul>
Comment 4 ssastry 2013-06-24 22:06:52 UTC
This seems to be a bug in the diff interface in mediawiki.  There are no extra newlines in the wikitext source as indicated by the diff.  The diff incorrectly signals newlines where there are now.

Steps to reproduce:

* Do everything as Krinkle says
* Actually save the page.
* Look at the new wikitext source and look at what the diff tells you.

I am leaving this bug open so others can verify independently.
Comment 5 ssastry 2013-06-24 22:07:48 UTC
There was a typo.  It should read:  ".... where there are *NONE* ...."
Comment 6 ssastry 2013-06-27 22:00:05 UTC
Please reopen if this an issue in Parsoid.

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


Navigation
Links