mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Escape backslashes and double quotes in SRGS attribute values.
This commit is contained in:
@@ -105,6 +105,9 @@ showsAttrs = concatS . map (showChar ' ' .) . map showsAttr
|
||||
showsAttr :: Attr -> ShowS
|
||||
showsAttr (n,v) = showString n . showString "=\"" . showString (escape v) . showString "\""
|
||||
|
||||
-- FIXME: escape double quotes
|
||||
-- FIXME: escape strange charachters with &#xxx;
|
||||
escape :: String -> String
|
||||
escape = id
|
||||
escape = concatMap escChar
|
||||
where
|
||||
escChar c | c `elem` ['"','\\'] = '\\':[c]
|
||||
| otherwise = [c]
|
||||
|
||||
Reference in New Issue
Block a user