Last modified: 2013-12-03 22:52:39 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 T53946, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51946 - Parsoid: empty span added after img when rendering math tags
Parsoid: empty span added after img when rendering math tags
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-24 10:10 UTC by Ed Sanders
Modified: 2013-12-03 22:52 UTC (History)
1 user (show)

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


Attachments

Description Ed Sanders 2013-07-24 10:10:50 UTC
1. Create a page with just <math>x=y</math>
2. API response is:
  [...]
  <body data-parsoid="{}">
    <p data-parsoid='{"dsr":[0,16,0,0]}'>
      <img class="tex" alt="x=y" src="[...]" typeof="mw:Extension/math" data-mw='[...]' data-parsoid='[...]' about="#mwt3">
      <span about="#mwt3" data-parsoid="{}">\n</span>
    </p>
  </body>

The extra span causes the hover shield to render incorrectly.

Interestingly the extra span doesn't appear when I use the Parsoid web service tester.
Comment 1 ssastry 2013-07-24 21:25:32 UTC
WFM.

See snippet of json response from api.php extracted from google-chrome (for User:Ssastry/VE_Test) extracted from Chrome's console

<p data-parsoid='{\"dsr\":[0,16,0,0]}'><img class=\"tex\" alt=\"x=y\" src=\"//upload.wikimedia.org/math/9/1/9/919860b52317a584e5de6f3257631d16.png\" typeof=\"mw:Extension/math\" data-mw='{\"name\":\"math\",\"attrs\":{},\"body\":{\"extsrc\":\"x=y\"}}' data-parsoid='{\"src\":\"<math>x=y</math>\",\"dsr\":[0,16]}' about=\"#mwt3\"></p>
Comment 2 ssastry 2013-07-24 21:26:28 UTC
Please reopen if still an issue.
Comment 3 Ed Sanders 2013-07-24 21:51:21 UTC
See the same as you on live, but get a span wrapped line break on my local copy with up to date master.
Comment 4 ssastry 2013-08-15 22:42:32 UTC
Ed, can you test this on some other extension, say gallery, sourcehighlight, hiero, etc.?  I dont have math installed locally and would like to avoid it if possible.  But, if this is specific to <math>, I will bite the bullet.
Comment 5 Gabriel Wicke 2013-12-03 22:51:28 UTC
http://parsoid-lb.eqiad.wikimedia.org/mediawikiwiki/User%3AGWicke%2FTest%2FMath?oldid=835467 looks ok to me as well. Trailing newlines returned by the math extension are encapsulated in spans to ensure round-tripping. The math extension however does not seem to return trailing newlines in this case.
Comment 6 Gabriel Wicke 2013-12-03 22:52:39 UTC
Please reopen if we add newlines that aren't returned by the extension.

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


Navigation
Links