diff --git a/src/QBar/TagParser.hs b/src/QBar/TagParser.hs index 8a9ea1468a7b161a579cf05aeb57d71bc4a5ce27..934d014bd9e511c7eee2eaafe5ff8a2b584e09c9 100644 --- a/src/QBar/TagParser.hs +++ b/src/QBar/TagParser.hs @@ -22,7 +22,11 @@ tagParser = parser (False, normalImportant) singleElementParser = choice [textParser, activeTagParser, importanceTagParser, spanParser] textParser :: Parser BlockText - textParser = mkText active importance . T.fromStrict <$> A.takeWhile1 (notInClass "<>") + textParser = mkText active importance . replaceSymbols . T.fromStrict <$> A.takeWhile1 (notInClass "<>") + + replaceSymbols :: Text -> Text + -- replaces & last to prevent the '&' from being interpreted again + replaceSymbols = T.replace "&" "&" . T.replace "<" "<" . T.replace ">" ">" activeTagParser :: Parser BlockText activeTagParser = string "<active>" *> parser (True, importance) <* string "</active>"