web: workaround for json encoding of </script> (#236)

This commit is contained in:
Simon Michael 2015-02-26 08:56:37 -08:00
parent d801eb1ab7
commit f83590021a

View File

@ -349,7 +349,8 @@ addform _ vd@VD{..} = [hamlet|
dates = ["today","yesterday","tomorrow"] :: [String] dates = ["today","yesterday","tomorrow"] :: [String]
descriptions = sort $ nub $ map tdescription $ jtxns j descriptions = sort $ nub $ map tdescription $ jtxns j
accts = sort $ journalAccountNamesUsed j accts = sort $ journalAccountNamesUsed j
listToJsonValueObjArrayStr as = preEscapedString $ encode $ JSArray $ map (\a -> JSObject $ toJSObject [("value", showJSON a)]) as escapeJSSpecialChars = regexReplaceCI "</script>" "<\\/script>" -- #236
listToJsonValueObjArrayStr as = preEscapedString $ escapeJSSpecialChars $ encode $ JSArray $ map (\a -> JSObject $ toJSObject [("value", showJSON a)]) as
numpostings = 4 numpostings = 4
postingnums = [1..numpostings] postingnums = [1..numpostings]
postingfields :: ViewData -> Int -> HtmlUrl AppRoute postingfields :: ViewData -> Int -> HtmlUrl AppRoute