Skip to content
Discussion options

You must be logged in to vote

The main reason is that underscores are more limited. (In many markdown dialects, intra-word underscores are not treated as emphasis.)

Anyway, yes, you can do it with a filter. It's not terribly hard. Here is one approach:

function Emph(el)
  if FORMAT == "markdown" then
    local underscore = pandoc.RawInline("markdown", "_")
    return ({underscore} .. el.content .. {underscore})
  end
end

function Strong(el)
  if FORMAT == "markdown" then
    local doubleunderscore = pandoc.RawInline("markdown", "__")
    return ({doubleunderscore} .. el.content .. {doubleunderscore})
  end
end

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jgm
Comment options

jgm Oct 6, 2025
Maintainer

Answer selected by joostkremers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants