I am using pandoc to convert HTML to Markdown to populate a github wiki. The only pandoc option I am using is -t gfm I would like to keep internal link identifiers from the HTML to arbitrary places on the wiki page (as opposed to relying on automatically generated heading identifiers). When I encounter a document anchor like this in the source HTML: fred Pandoc converts it to this in the output: fred However, github wiki does not render this as a valid target, so my URL https://github.com/name/repo/wiki#fred does not jump to the proper point on the wiki page. However, if it was left as an anchor instead of a span, i.e. fred Then github would render it properly and the URL would jump to the correct position in the document. The internal link would also work if coded in a "div" tag: