diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-08-03 08:00:36 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-08-03 08:00:36 +0200 |
| commit | 2fdf04f54a2d4fe68068ebeb232624e3dcce24b7 (patch) | |
| tree | b234fa5537d59800c03573c002c105eb467b25ab | |
| parent | 3ed7dcd401e286d9e0b9ca5ea923f671699e7417 (diff) | |
| download | graphql-2fdf04f54a2d4fe68068ebeb232624e3dcce24b7.tar.gz | |
Remove leading carriage return in gql
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | graphql.cabal | 3 | ||||
| -rw-r--r-- | src/Language/GraphQL/TH.hs | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b37a40b..e615468 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on and this project adheres to [Haskell Package Versioning Policy](https://pvp.haskell.org/). +## [Unreleased] +### Fixed +- `gql` removes not only leading `\n` but also `\r`. + ## [1.2.0.1] - 2023-04-25 ### Fixed - Support hspec 2.11. @@ -508,6 +512,7 @@ and this project adheres to ### Added - Data types for the GraphQL language. +[Unreleased]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.1...master [1.2.0.1]: https://git.caraus.tech/OSS/graphql/compare/v1.2.0.0...v1.2.0.1 [1.2.0.0]: https://git.caraus.tech/OSS/graphql/compare/v1.1.0.0...v1.2.0.0 [1.1.0.0]: https://git.caraus.tech/OSS/graphql/compare/v1.0.3.0...v1.1.0.0 diff --git a/graphql.cabal b/graphql.cabal index 72f81e4..bcf69af 100644 --- a/graphql.cabal +++ b/graphql.cabal @@ -21,7 +21,8 @@ extra-source-files: CHANGELOG.md README.md tested-with: - GHC == 9.2.5 + GHC == 9.2.8, + GHC == 9.6.2 source-repository head type: git diff --git a/src/Language/GraphQL/TH.hs b/src/Language/GraphQL/TH.hs index b6bc18c..8e1fcb3 100644 --- a/src/Language/GraphQL/TH.hs +++ b/src/Language/GraphQL/TH.hs @@ -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 |
