From d226a35c0ac6485c75f083ce3b25ada1d623f45f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 25 Oct 2021 08:48:18 -0700 Subject: Switch back from HsYAML to yaml. Reasons: - Performance: HsYAML is around 20 times slower in parsing large YAML bibliographies (#6084). - An issue was submitted to HsYAML, but it hasn't gotten any attention. HsYAML seems borderline unmaintained; it hasn't had a commit in over a year. - Unfortunately this goes back on our attempts to free ourselves from C dependencies (#4535). But I don't see a better alternative until a better pure Haskell parser is available. Closes #6084. Notes: - We've removed the FromYAML instances for all types that had them, since this is a HsYAML-specific typeclass [API change]. (The yaml package just uses From/ToJSON.) - Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N', 'Yes', 'No', 'On', 'Off' as boolean values. Users may need to quote these when they are meant to be interpreted as strings. Similarly, 'null' is parsed as a YAML null value (and will be treated as an empty string by pandoc rather than the string 'null'). Quoting it will force it to be interpreted as a string. - Some tests had to be adjusted accordingly. - Pandoc now behaves better when the YAML metadata contains escaping errors: instead of just falling back on treating the section as a table, it raises a YAML parsing error. --- pandoc.cabal | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pandoc.cabal') diff --git a/pandoc.cabal b/pandoc.cabal index 458e69ab6..f442bc18c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -522,7 +522,6 @@ common common-executable library import: common-options build-depends: Glob >= 0.7 && < 0.11, - HsYAML >= 0.2 && < 0.3, JuicyPixels >= 3.1.6.1 && < 3.4, SHA >= 1.6 && < 1.7, aeson >= 0.7 && < 2.1, @@ -567,6 +566,8 @@ library network-uri >= 2.6 && < 2.8, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, + pretty >= 1.1 && < 1.2, + pretty-show >= 1.10 && < 1.11, process >= 1.2.3 && < 1.7, random >= 1 && < 1.3, safe >= 0.3.18 && < 0.4, @@ -581,14 +582,13 @@ library text >= 1.1.1.0 && < 1.3, text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.13, + unicode-collation >= 0.1.1 && < 0.2, unicode-transforms >= 0.3 && < 0.4, xml >= 1.3.12 && < 1.4, xml-conduit >= 1.9.1.1 && < 1.10, - unicode-collation >= 0.1.1 && < 0.2, + yaml >= 0.11 && < 0.12, zip-archive >= 0.2.3.4 && < 0.5, - zlib >= 0.5 && < 0.7, - pretty-show >= 1.10 && < 1.11, - pretty >= 1.1 && < 1.2 + zlib >= 0.5 && < 0.7 if os(windows) && arch(i386) build-depends: basement >= 0.0.10, foundation >= 0.0.23 -- cgit v1.2.3