@@ -274,7 +274,8 @@ ignoreUntil :: IParser a -> IParser (Maybe a)
274274ignoreUntil end = go
275275 where
276276 ignore p = const () <$> p
277− filler = choice [ ignore multiComment
277+ filler = choice [ ignore str
278+ , ignore multiComment
278279 , ignore (markdown (\_ _ -> mzero))
279280 , ignore anyChar
280281 ]
@@ -317,4 +318,22 @@ markdown interpolation = try (string "[markdown|") >> closeMarkdown "" []
317318 , uncurry closeMarkdown =<< interpolation md stuff
318319 , do c <- anyChar
319320 closeMarkdown (md ++ [c]) stuff
320− ]
321+ ]
322+
323+str :: IParser String
324+str = choice [ quote >> dewindows <$> manyTill (backslashed <|> anyChar) quote
325+ , liftM dewindows . expecting "string" . betwixt '"' '"' . many $
326+ backslashed <|> satisfy (/='"')
327+ ]
328+ where
329+ quote = try (string "\"\"\"")
330+
331+ -- Remove \r from strings to fix generated JavaScript
332+ dewindows [] = []
333+ dewindows cs =
334+ let (pre, suf) = break (`elem` ['\r','\n']) cs
335+ in pre ++ case suf of
336+ ('\r':'\n':rest) -> '\n' : dewindows rest
337+ ('\n':rest) -> '\n' : dewindows rest
338+ ('\r':rest) -> '\n' : dewindows rest
339+ _ -> []