mastodon-unfurl.love/0044-dehtml

15 lines
325 B
Plaintext

dehtml = function(s)
return s:gsub('<p>', '\n\n')
:gsub('<br>', '\n')
:gsub('<br/>', '\n')
-- hacky
:gsub('<[^>]*>', '')
:gsub('&#39;', "'")
:gsub('&apos;', "'")
:gsub('&quot;', '"')
:gsub('&ldquo;', '"')
:gsub('&rdquo;', '"')
:gsub('&lt;', '<')
:gsub('&gt;', '>')
:gsub('&amp;', '&')
end