md_escape: Escape [] richtig (danke @Akamaru)

This commit is contained in:
Andreas Bielawski
2016-07-17 20:35:44 +02:00
parent 709b31ae8e
commit faf06cca2a
2 changed files with 3 additions and 10 deletions

View File

@ -490,15 +490,8 @@ end
function utilities.markdown_escape(text)
text = text:gsub('_', '\\_')
text = text:gsub('%[', '\\[')
text = text:gsub('%]', '\\]')
text = text:gsub('%*', '\\*')
text = text:gsub('`', '\\`')
return text
end
function utilities.markdown_escape_simple(text)
text = text:gsub('_', '\\_')
text = text:gsub('%[', '[[')
text = text:gsub('%]', ']]')
text = text:gsub('%*', '\\*')
text = text:gsub('`', '\\`')
return text