Last modified: 2013-02-25 22:44:15 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.
Created attachment 11839 [details] HTML of {{disambiguation}} on [[Loco]] at en.wikipedia.org
Created attachment 11840 [details] Screenshot of {{disambiguation}} from Parsoid
Created attachment 11841 [details] HTML of {{disambiguation}} from Parsoid The main problem is the presence of a <pre> that shouldn't be there.
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.
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.
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.
A reasonable resolution of this issue. :)