Last modified: 2013-02-25 22:44:15 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 T47341, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45341 - Parsoid: Incorrect rendering for [[Template:Disambiguation]]
Parsoid: Incorrect rendering for [[Template:Disambiguation]]
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: ssastry
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-24 23:41 UTC by Krinkle
Modified: 2013-02-25 22:44 UTC (History)
2 users (show)

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


Attachments
Screenshot of {{disambiguation}} on [[Loco]] at en.wikipedia.org (30.29 KB, image/png)
2013-02-24 23:41 UTC, Krinkle
Details
HTML of {{disambiguation}} on [[Loco]] at en.wikipedia.org (1.03 KB, text/html)
2013-02-24 23:42 UTC, Krinkle
Details
Screenshot of {{disambiguation}} from Parsoid (35.25 KB, image/png)
2013-02-24 23:43 UTC, Krinkle
Details
HTML of {{disambiguation}} from Parsoid (1.57 KB, text/html)
2013-02-24 23:45 UTC, Krinkle
Details

Description Krinkle 2013-02-24 23:41:59 UTC
Created attachment 11838 [details]
Screenshot of {{disambiguation}} on [[Loco]] at en.wikipedia.org

Using {{disambiguation}} on a page and editing it with VisualEditor shows an incorrect rendering.

Attached are screenshots and dumps of the active DOM for the PHP parser and Parsoid/VisualEditor.
Comment 1 Krinkle 2013-02-24 23:42:53 UTC
Created attachment 11839 [details]
HTML of {{disambiguation}} on [[Loco]] at en.wikipedia.org
Comment 2 Krinkle 2013-02-24 23:43:51 UTC
Created attachment 11840 [details]
Screenshot of {{disambiguation}} from Parsoid
Comment 3 Krinkle 2013-02-24 23:45:31 UTC
Created attachment 11841 [details]
HTML of {{disambiguation}} from Parsoid

The main problem is the presence of a <pre> that shouldn't be there.
Comment 4 ssastry 2013-02-25 20:06:54 UTC
This might be a bug in https://gerrit.wikimedia.org/r/#/c/32405/ or a regression.  The <pre> is coming from an #if parser function which should not have as per that commit message.

Will investigate.
Comment 5 ssastry 2013-02-25 21:04:34 UTC
This can be narrowed down to the difference between these two table cells.  Look at PHP parser output for these two tds in the table:

<table>
<tr>
<td>
  a</td>
<td>
 b
</td>
</tr>
</table>

"a" is not wrapped in a pre-tag, but "b" is.  

http://www.mediawiki.org/wiki/User:Ssastry/Tests:Odd_pre_in_td_behavior

Parsoid wraps both in a pre-tag which is the reason why Parsoid output is different from PHP output.  This seems a PHP parser bug to me, not a Parsoid bug.  I imagine we want to be bug-to-bug compatible, but I am not sure what the correct behavior for this is.
Comment 6 Krinkle 2013-02-25 22:39:06 UTC
Indeed. The following edit by me fixed it for Parsoid:

https://en.wikipedia.org/w/index.php?title=Template%3ADmbox&diff=540384230&oldid=466538335

Seems like a reasonable change to make. Not sure how common this is but I think in most cases editors will understand as in most cases this is already how it is. Leading space after a line break causes a <pre>. The reason the line break is there is probably by mistake, and nothing broke so it was forgotten/left.

Lets hope it is not too common.
Comment 7 ssastry 2013-02-25 22:44:15 UTC
A reasonable resolution of this issue. :)

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


Navigation
Links