Skip to content

Commit

Permalink
Data.XML must escape the data as well
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed May 17, 2024
1 parent 6d7071f commit d515cfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/compiler/api/GF/Data/XML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module GF.Data.XML (XML(..), Attr, comments, showXMLDoc, showsXMLDoc, showsXML,

import GF.Data.Utilities

data XML = Data String | CData String | Tag String [Attr] [XML] | ETag String [Attr] | Comment String | Empty
data XML = Data String | Tag String [Attr] [XML] | ETag String [Attr] | Comment String | Empty
deriving (Ord,Eq,Show)

type Attr = (String,String)
Expand All @@ -26,8 +26,7 @@ showsXMLDoc xml = showString header . showsXML xml
showsXML :: XML -> ShowS
showsXML = showsX 0 where
showsX i x = ind i . case x of
(Data s) -> showString s
(CData s) -> showString "<![CDATA[" . showString s .showString "]]>"
(Data s) -> showString (escape s)
(ETag t as) -> showChar '<' . showString t . showsAttrs as . showString "/>"
(Tag t as cs) ->
showChar '<' . showString t . showsAttrs as . showChar '>' .
Expand Down
7 changes: 0 additions & 7 deletions src/compiler/api/GF/Speech/VoiceXML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ param name expr = ETag "param" [("name",name),("expr",expr)]
var :: String -> Maybe String -> XML
var name expr = ETag "var" ([("name",name)]++e)
where e = maybe [] ((:[]) . (,) "expr") expr
{-
script :: String -> XML
script s = Tag "script" [] [CData s]
scriptURI :: String -> XML
scriptURI uri = Tag "script" [("uri", uri)] []
-}
--
-- * ECMAScript stuff
--
Expand Down

0 comments on commit d515cfd

Please sign in to comment.