I tested several direct and indirect conversions between syntaxes using pandoc, and the one that works best is from docx to commonmark, then pasting in xwiki editor using commonmark syntax, then switching syntax to xwiki 2.1.
The correct input and output is:
When I use pandoc to directly convert docx to xwiki, the external links, bullet lists and numbered hierarchical lists are coming out not well in the final display:
Not sure though whether this forum is the right place to address this.
A workaround could be to do the cleanup of the empty lines scripted. But this issue isn’t the only one. You can unwillingly apply so many weird formattings in a Word document which you just don’t see and don’t notice (even after displaying the hidden format symbols) but hinder the converter to function correctly. And after downloading from Google Docs, it’s even worse because also GDocs has the same problem of unwanted weird formattings which occur after working a while with the doc. There’s no easy general solution I’m afraid.
Just found this topic, one additional remark: Pandoc’s XWiki syntax implementation is not maintained by the XWiki development team and I don’t think the developers of Pandoc monitor this forum. So please report a bug in their issue tracker if you want this to be fixed in Pandoc.