From c2a49d6ea46c38f107ac1a47a965e4777be2aecc Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 2 Dec 2021 02:27:30 +0100 Subject: do (naïve) html escaping because we can't ever trust workadventure, apparently. why are we using that thing again? --- lib/Util.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Util.hs') diff --git a/lib/Util.hs b/lib/Util.hs index 18dfb5b..948b725 100644 --- a/lib/Util.hs +++ b/lib/Util.hs @@ -35,6 +35,7 @@ instance PrettyPrint PropertyValue where prettyprint = \case StrProp str -> str BoolProp bool -> if bool then "true" else "false" + IntProp int -> showText int -- | here since Unit is sometimes used as dummy type instance PrettyPrint () where @@ -54,3 +55,8 @@ layerIsEmpty :: Layer -> Bool layerIsEmpty layer = case layerData layer of Nothing -> True Just d -> all ((==) $ mkTiledId 0) d + +-- | naive escaping of html sequences, just to be sure that +-- | workadventure won't mess things up again … +naiveEscapeHTML :: Text -> Text +naiveEscapeHTML = T.replace "<" "<" . T.replace ">" ">" -- cgit v1.2.3