uri-encode capture values in the generated javascript code for servant-jquery

This commit is contained in:
Alp Mestanogullari 2014-11-25 15:58:08 +01:00
parent 06d8c8005a
commit e3af6a6af3

View File

@ -35,7 +35,7 @@ segmentToStr :: Segment -> Bool -> String
segmentToStr (Static s) notTheEnd =
if notTheEnd then s else s ++ "'"
segmentToStr (Cap s) notTheEnd =
"' + " ++ s ++ if notTheEnd then " + '" else ""
"' + encodeURIComponent(" ++ s ++ if notTheEnd then ") + '" else ")"
type Path = [Segment]