Emphasize multiple word in markdown with a Lua filter

Viewed 67

I have a lua filter that serves to emphasize words in a markdown file (executed by Pandoc). This filter works well and looks as follows

return {
    {
      Str = function (elem)
        if elem.text == "Text" then
          return pandoc.Strong {elem.text}
        else
          return elem
        end
      end,
    }
  }

What I am now trying to achieve is that not only single words can be emphasised but also bigger strings. For example

return {
    {
      Str = function (elem)
        if elem.text == "Make this Text bold" then
          return pandoc.Strong {elem.text}
        else
          return elem
        end
      end,
    }
  }

However, this does not work. It seems that the filter is working word by word. So, it makes sense that it is not working. But I could not find any other solution.

Can anybody help?

0 Answers
Related