Commit c693ce30 authored by Thomas Peiselt's avatar Thomas Peiselt

markup removal improvements.

it's possible to have some content between `<span class=name>` and `<0>`
so separating the expressions to handle this case.
parent 972450cd
...@@ -272,8 +272,10 @@ link = printf "<a target='_blank' href='%s'>%s</a>" ...@@ -272,8 +272,10 @@ link = printf "<a target='_blank' href='%s'>%s</a>"
removeMarkup :: String -> String removeMarkup :: String -> String
removeMarkup s = T.unpack $ List.foldl (flip ($)) (T.pack s) replaceAll removeMarkup s = T.unpack $ List.foldl (flip ($)) (T.pack s) replaceAll
where replacements :: [ (T.Text, T.Text) ] where replacements :: [ (T.Text, T.Text) ]
replacements = [ ( "<span class=name><0>", "" ) replacements = [ ( "<span class=name>", "" )
, ( "</0></span>", "" ) , ( "</span>", "" )
, ( "<0>", "" )
, ( "</0>", "" )
, ( "&gt;", ">" ) , ( "&gt;", ">" )
, ( "&lt;", "<" ) , ( "&lt;", "<" )
, ( "<b>", "") , ( "<b>", "")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment