diff --git a/src/GF/JavaScript/PrintJS.hs b/src/GF/JavaScript/PrintJS.hs index f901a62df..9f85a58e9 100644 --- a/src/GF/JavaScript/PrintJS.hs +++ b/src/GF/JavaScript/PrintJS.hs @@ -26,10 +26,10 @@ render d = rend 0 (map ($ "") $ d []) "" where space t = showString t . (\s -> if null s then "" else (' ':s)) spaceAfter :: String -> Bool -spaceAfter = (`notElem` [".","(","["]) +spaceAfter = (`notElem` [".","(","[","\n"]) spaceBefore :: String -> Bool -spaceBefore = (`notElem` [",",".",":",";","(",")","[","]","{","}"]) +spaceBefore = (`notElem` [",",".",":",";","(",")","[","]","{","}","\n"]) parenth :: Doc -> Doc parenth ss = doc (showChar '(') . ss . doc (showChar ')')