I need to convert HTML meeting notes to wikitext (steps). @GWicke suggested I use parsoid, so I used rest_v1's /html/to/wikitext/{title}/{revision} transform. It worked but I got some unexpected wikitext.
Steps to reproduce:
- get typical HTML output from a tool, e.g.
<h2 class="c0"><a name="h.83986x7wjhtl"></a><span>Pending action items</span></h2> <a name="foo"></a>Now some text.
- Visit mediawiki.org/api/rest_v1
- Open Transforms >[Post] /transform/html/to/wikitext/{title}/{revision}
- Paste the HTML above into html field.
- Click [Try it out!]
Results:
== [ ]<span>Pending action items</span> == [ ]Now some text.
The square brackets are unexpected. A <a href="some/url"> hyperlink is represented in wikitext using square brackets, but an anchor name is never represented that way.
Expected behavior:
Is Parsoid even supposed to work on arbitrary HTML?
{{Anchor}} wikitext templates typically output <span id="foo"></span>, but maybe parsoid transforming anchor HTML into span HTML is also unexpected.