Remove leading carriage return in gql

This commit is contained in:
2023-08-03 08:00:36 +02:00
parent 3ed7dcd401
commit 2fdf04f54a
3 changed files with 8 additions and 2 deletions

View File

@ -21,7 +21,7 @@ stripIndentation code = reverse
indent count (' ' : xs) = indent (count - 1) xs
indent _ xs = xs
withoutLeadingNewlines = dropNewlines code
dropNewlines = dropWhile (== '\n')
dropNewlines = dropWhile $ flip any ['\n', '\r'] . (==)
spaces = length $ takeWhile (== ' ') withoutLeadingNewlines
-- | Removes leading and trailing newlines. Indentation of the first line is