jgm/pandoc

--from=html: Allow plain text rendering of links and images

jidanni opened this issue · 1 comments

--from=html , etc: 2 feature ideas:

  • Allow disabling images and just rendering their ALT= attributes, like w3m -dump can.
  • Allow disabling links and just rendering their text portions, like w3m -dump can.
    so "Ho <a>bla</a>" becomes just "Ho bla"

Here's how I accomplished it:
https://stackoverflow.com/questions/78352645/xmllibxml-how-to-replace-nodes-with-their-content/78353552#78353552

jgm commented

Both can easily be accomplished in pandoc using a short Lua filter.

function Image(el)
  return el.caption
end
function Link(el)
  return el.content
end