Last modified: 2013-11-21 20:00:08 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 T58732, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56732 - A-tags should always be serialized to wikitext, even if missing rdf info
A-tags should always be serialized to wikitext, even if missing rdf info
Status: NEW
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-07 19:01 UTC by ssastry
Modified: 2013-11-21 20:00 UTC (History)
2 users (show)

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


Attachments

Description ssastry 2013-11-07 19:01:59 UTC
https://fr.wikipedia.org/w/index.php?title=Marcel_Kanche&curid=6288130&diff=98045658&oldid=97964282

Looks like that new line is missing rdf info and parsoid dutifully serialized it as an a-tag. I think Parsoid should have a fallback strategy of converting them to wikilinks/extlinks.
Comment 1 Elitre 2013-11-11 16:07:45 UTC
Thanks for reporting this!!!
Comment 2 Gabriel Wicke 2013-11-12 17:11:56 UTC
Closely related: bug 53568 (Automatically switch from wikitext to HTML syntax in serializer when attributes were added to elements). We basically need a method to generically figure out whether an element (in this case, a link) can be serialized to wikitext or needs / can be serialized to HTML.

Also related: bug 33886 (allow <a> tags)
Comment 3 ssastry 2013-11-21 20:00:08 UTC
We currently already do support some form of this. It is only when the a-tag also has attributes that we emit the a-tag. See below

[subbu@earth lib] echo "<a href="http://foo.com">bar</a>" | node parse --html2wt
[http://foo.com bar]
[subbu@earth lib] echo "<a title='foobar' href="http://foo.com">bar</a>" | node parse --html2wt
<a title="foobar" href="http://foo.com">bar</a>

However, a case can be made to drop attributes as well since we currently do drop them on a-tags with recognized RDFa attributes

subbu@earth lib] echo "<a href="http://foo.com">bar</a>" | node parse --html2wt
[http://foo.com bar]
[subbu@earth lib] echo "<a title='foobar' href="http://foo.com">bar</a>" | node parse --html2wt
<a title="foobar" href="http://foo.com">bar</a>

So, this is more a matter of getting some clarity around how to handle HTML attributes in a-tags (since they cannot be represented at all in wikitext). Do we consistently drop them in all cases? In that scenario, we can always serialize any a-tag to an extlink as a default.

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


Navigation
Links