Last modified: 2014-11-13 17:42:12 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 T49963, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47963 - Block content in links.
Block content in links.
Status: NEW
Product: Parsoid
Classification: Unclassified
DOM (Other open bugs)
unspecified
All All
: Low normal
: ---
Assigned To: Parsoid Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-02 04:12 UTC by C. Scott Ananian
Modified: 2014-11-13 17:42 UTC (History)
3 users (show)

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


Attachments

Description C. Scott Ananian 2013-05-02 04:12:53 UTC
http://parsoid.wmflabs.org:8001/latestresult/zh/EOS
contains
[[佳能 EOS 300D|300D<p>Digital Rebel<p>Kiss Digital]]

block content inside links is problematic:

> div = document.createElement('div')
<div>​</div>​
> div.innerHTML = '<a href="foo">foo<p>bar</a>'
"<a href="foo">foo<p>bar</a>"
> div.outerHTML
"<div><a href="foo">foo</a><p><a href="foo">bar</a></p></div>"
Comment 1 C. Scott Ananian 2013-05-02 04:22:52 UTC
This is probably related to bug 47326... but bug 47326 is fixable.  Not sure that this particular bug is fixable, since our DOM fundamentally does not let us represent block content inside an <a> tag.

OTOH, it's interesting that we currently round trip:

  [[佳能 EOS 300D|300D<p>Digital Rebel<p>Kiss Digital]]

to

  [[佳能 EOS 300D|300D<p>Digital Rebel]]<p>[[佳能 EOS 300D|Kiss Digital]]</p>

ie, we managed to deal with the first <p> somehow.  We might be able to recombine these tags in the html2wt phase.
Comment 2 Gabriel Wicke 2013-05-02 04:28:15 UTC
Note that this is not true in production. The p tags in the first half are round-tripped with a meta tag based trick that is not safe when content can be edited. This trick is mainly used to hide noise in round-trip testing without selective serialization. parse.js defaulted to this trick so far, which I just submitted a patch for.
Comment 3 Gabriel Wicke 2013-05-07 23:57:52 UTC
Also, selective serialization is thrown off by overlapping source ranges (it duplicates the nested paragraph source). Not sure if that can be improved on by forbidding range overlaps in the dsr pass.

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


Navigation
Links