aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Html.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Html.hs b/src/Html.hs
index f4efa218..ae14c9ae 100644
--- a/src/Html.hs
+++ b/src/Html.hs
@@ -19,6 +19,9 @@ module Html (
import qualified BlockTable as BT
+import Data.Char (isAscii, ord)
+import Numeric (showHex)
+
infixr 2 +++ -- combining Html
infixr 7 << -- nesting Html
infixl 8 ! -- adding optional arguments
@@ -152,7 +155,9 @@ stringToHtmlString = concatMap fixChar
fixChar '>' = "&gt;"
fixChar '&' = "&amp;"
fixChar '"' = "&quot;"
- fixChar c = [c]
+ fixChar c
+ | isAscii c = [c]
+ | otherwise = "&#x" ++ showHex (ord c) ";"
-- ---------------------------------------------------------------------------
-- Classes