[snip]
-- Encode/escape certain characters inside Markdown code runs.
-- The point is that in code, these characters are literals,
-- and lose their special Markdown meanings.
function encode_code(s)
s = s:gsub("%&", "&")
s = s:gsub("<", "<")
s = s:gsub(">", ">")
for k,v in pairs(escape_table) do
s = s:gsub("%"..k, v)
end
return s
end
I've played with calling Vim, but - as a newcomer - imagined that
the necessary Lua code had already been written and would be
better than trying to interact with other processes... I had also
imagined that it would be simpler... :)