diff --git a/otouto/plugins/youtube.lua b/otouto/plugins/youtube.lua index 2d490b4..27d71e1 100644 --- a/otouto/plugins/youtube.lua +++ b/otouto/plugins/youtube.lua @@ -98,7 +98,7 @@ function get_yt_thumbnail(data) end function send_youtube_data(data, msg, self, link, sendpic) - local title = utilities.markdown_escape_simple(data.snippet.localized.title) + local title = utilities.md_escape(data.snippet.localized.title) -- local description = data.snippet.localized.description local uploader = data.snippet.channelTitle local upload_date = makeOurDate(data.snippet.publishedAt) diff --git a/otouto/utilities.lua b/otouto/utilities.lua index 763359b..6e8d98f 100644 --- a/otouto/utilities.lua +++ b/otouto/utilities.lua @@ -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