pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

MediaWiki to Texinfo ignores `<var>` and `<samp>` tags

Open lemzwerg opened this issue 1 month ago • 1 comments

[pandoc 3.8.2.1]

MediaWiki code like

<var>foo</var>
<samp>bar</samp>

gets translated to foo bar, i.e., the tags are ignored. This is incorrect. The tag <var> has a direct correspondence in Texinfo, namely @var. <samp> can be probably translated best as @samp, but @code might be an alternative (I prefer the former, though). BTW, <var> should also work in <code>.

According to https://www.mediawiki.org/wiki/Help:HTML_in_wikitext, both tags are valid in MediaWiki text.

lemzwerg avatar Nov 21 '25 15:11 lemzwerg

Currently these are just parsed as raw HTML tags (and hence will only be transmitted to formats that allow raw HTML).

It could be a good idea instead to parse content in the tags listed at https://www.mediawiki.org/wiki/Help:HTML_in_wikitext as Span elements with a special class. That would then allow writers like TexInfo to do something with them.

jgm avatar Nov 22 '25 09:11 jgm