diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-02-01 10:24:37 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-02-01 10:24:37 +0000 |
| commit | 992e212bccec9f30ee7b4f5e764b0bd793ccc651 (patch) | |
| tree | 80096d60cbb025a9fcf11132ab553f223c151182 /src/GF | |
| parent | 36492443e970de022b7dd5ddbe463616bb6c56e4 (diff) | |
Escape backslashes and double quotes in SRGS attribute values.
Diffstat (limited to 'src/GF')
| -rw-r--r-- | src/GF/Speech/PrSRGS.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GF/Speech/PrSRGS.hs b/src/GF/Speech/PrSRGS.hs index 4044f097f..63775c852 100644 --- a/src/GF/Speech/PrSRGS.hs +++ b/src/GF/Speech/PrSRGS.hs @@ -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
\ No newline at end of file +escape = concatMap escChar + where + escChar c | c `elem` ['"','\\'] = '\\':[c] + | otherwise = [c] |
