Page MenuHomePhabricator

Fix wikitext output for <a> anchor tags
Closed, ResolvedPublic

Description

$ echo '<a id="foo">bat</a>' | tests/parse.js --html2wt
<a id="foo">bat</a>

Unfortunately, that's not wikitext.

After https://gerrit.wikimedia.org/r/200914 is merged:

$ echo '<a id="foo"></a>' | tests/parse.js --html2wt
[error/html2wt][enwiki/Main Page] Encountered <a id="foo"></a> -- serializing as extlink and dropping <a> attributes unsupported in wikitext.
[ ]

...which is no better (some might say, worse).

We should probably just emit bat in this case (and log a warning).

Event Timeline

cscott raised the priority of this task from to Needs Triage.
cscott updated the task description. (Show Details)
cscott added a project: Parsoid.
cscott subscribed.
ssastry triaged this task as Medium priority.Apr 1 2015, 10:50 PM
ssastry set Security to None.

See also T94599, which proposes stripping the linkage (emitting just bat in the example above) for the bad title text case as well.

ssastry claimed this task.
ssastry subscribed.

See also T94599, which proposes stripping the linkage (emitting just bat in the example above) for the bad title text case as well.

[subbu@earth:~/work/wmf/parsoid] echo '<a id="foo">bat</a>' | php bin/parse.php --html2wt
[error/html2wt/link] Encountered <a id="foo" data-object-id="1">bat</a> -- serializing as extlink and dropping <a> attributes unsupported in wikitext.
bat