@@ -274,7 +274,8 @@ ignoreUntil :: IParser a -> IParser (Maybe a)
274ignoreUntil end = go
274ignoreUntil end = go
276 ignore p = const () <$> p
276 ignore p = const () <$> p
277− filler = choice [ ignore multiComment
277+ filler = choice [ ignore str
278+ , ignore multiComment
278 , ignore (markdown (\_ _ -> mzero))
279 , ignore (markdown (\_ _ -> mzero))
279 , ignore anyChar
280 , ignore anyChar
@@ -317,4 +318,22 @@ markdown interpolation = try (string "[markdown|") >> closeMarkdown "" []
317 , uncurry closeMarkdown =<< interpolation md stuff
318 , uncurry closeMarkdown =<< interpolation md stuff
318 , do c <- anyChar
319 , do c <- anyChar
319 closeMarkdown (md ++ [c]) stuff
320 closeMarkdown (md ++ [c]) stuff
323+str :: IParser String
324+str = choice [ quote >> dewindows <$> manyTill (backslashed <|> anyChar) quote
325+ , liftM dewindows . expecting "string" . betwixt '"' '"' . many $
326+ backslashed <|> satisfy (/='"')
329+ quote = try (string "\"\"\"")
331+ -- Remove \r from strings to fix generated JavaScript
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