hb.Sara
hb.Sara

Reputation: 341

Pandoc conversion from Mediawiki to GFM

Facing issues while trying to convert MediaWiki file using Pandoc to GitHub Flavored Markdown, we have some templates like showing below:

{|cellspacing="0" cellpadding = "10" style="border-style:solid; border-color:black; border-width:1px;" width="100%"
| Some text....
|}

The script fail with the error:

Error at "source" (line 156, column 19):
unexpected "c"
expecting lf new-line, "!", "<" or "|"
{|cellspacing="0" cellpadding = "10" style="border-style:solid; border-color:black; border-width:1px;" width="100%"
                  ^
pandoc --from=mediawiki --to=gfm C:\Users\xxx\AppData\Local\Temp/pandoc5c93ace7d42b7

Any suggestions, thank you for your support.

Upvotes: 3

Views: 1641

Answers (1)

tarleb
tarleb

Reputation: 22609

Pandoc cannot read the exported XML, but only the actual MediaWiki markup. The markup is exported as part of the XML, but has to be extracted via an XML processor if one wants to feed it into pandoc.

Look for the element(s) /mediawiki/page[ns=0]/revision/text (XPath).

Upvotes: 2

Related Questions