The reason no doubt is that Pandoc has nothing in its document model which corresponds to `<samp>`. 

If you use the `+raw_html` extension (`--from=html+raw_html`) you can use a simple Lua filter to convert the raw HTML tags to the appropriate raw Texinfo:

````lua
local samp_for = {
  ['<samp>'] = pandoc.RawInline('texinfo', '@samp{'),
  ['</samp>'] = pandoc.RawInline('texinfo', '}')
}

function RawInline (elem)
  if 'html' ~= elem.format then
    return nil
  elseif samp_for[elem.text] then
    return samp_for[elem.text]
  else
    return nil
  end
end
````

I have often wished for an option or extension which will cause "unknown" HTML elements or LaTeX commands/environments to be converted into a span or div with a `tag` or `command`/`environment` attribute so that e.g. `<samp>foo</samp>` becomes what in Markdown would become `[foo]{tag=samp}`, `\foo[bar]{baz}` would becomes what in Markdown would become `[[bar]{command="foo" arg="1"}[baz]{command="foo" arg="2"}]{command="foo"}` and `\begin{foo}[bar]{baz}text\end{foo}` becomes 

````Markdown
::: {environment="foo"  arg1="bar" arg2="baz"}
text
:::
````

since this would in most cases make it much easier to use filters to make something sensible of "unknown" tags/commands/environments.

At one point I wrote a filter in Perl which implemented this for LaTeX, including both preserving LaTeX arguments "raw" as attributes and calling out to pandoc to parse the content of arguments and environments.  It was much harder with HTML since I had to loop through the contents of any elements which might contain raw HTML and "capture" raw opening tags and what follows them up to the closing tag if any, including keeping track of nested tags.
I suppose such a filter might be written in Lua too, but parsing LaTeX arguments and raw HTML attributes would be considerably more hairy due to the limitations of Lua patterns compared to Perl regexes.

Den sön 6 okt. 2019 09:47Werner LEMBERG <wl-mXXj517/zsQ@public.gmane.org> skrev:

[pandoc 2.6]


I convert from HTML to texinfo, and I noticed that

  <samp>foo</samp>

gets translated to

  foo

instead of the expected

  @samp{foo}   .

Doing

  git grep -i 'samp[^l]'

in pandoc's repository I don't see support for the '<samp>' HTML tag
at all.  Am I missing something?  Is this intentional?


    Werner

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBQWxXYZS03xg000oiPDwk4q39Tb6XCUWm-6khF8Q9L8A%40mail.gmail.com.