Fix route parsing for CRLF line endings

This commit is contained in:
Michael Snoyman 2017-02-07 15:23:35 +02:00
parent e90b31bb4a
commit 954f813569

View File

@ -63,7 +63,7 @@ parseRoutesNoCheck = QuasiQuoter
-- invalid input. -- invalid input.
resourcesFromString :: String -> [ResourceTree String] resourcesFromString :: String -> [ResourceTree String]
resourcesFromString = resourcesFromString =
fst . parse 0 . filter (not . all (== ' ')) . lines fst . parse 0 . filter (not . all (== ' ')) . lines . filter (/= '\r')
where where
parse _ [] = ([], []) parse _ [] = ([], [])
parse indent (thisLine:otherLines) parse indent (thisLine:otherLines)