jira-wiki-markup 1.4.0 → 1.5.0
raw patch · 17 files changed
+104/−73 lines, 17 filesdep ~mtlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: mtl
API changes (from Hackage documentation)
+ Text.Jira.Parser.Shared: icon' :: Parsec Text u Icon
Files
- CHANGELOG.md +13/−0
- LICENSE +1/−1
- README.md +4/−2
- jira-wiki-markup.cabal +37/−52
- src/Text/Jira/Markup.hs +1/−1
- src/Text/Jira/Parser.hs +1/−1
- src/Text/Jira/Parser/Block.hs +1/−1
- src/Text/Jira/Parser/Core.hs +1/−1
- src/Text/Jira/Parser/Inline.hs +8/−4
- src/Text/Jira/Parser/PlainText.hs +2/−2
- src/Text/Jira/Parser/Shared.hs +8/−2
- src/Text/Jira/Printer.hs +1/−1
- test/Text/Jira/Parser/BlockTests.hs +1/−1
- test/Text/Jira/Parser/InlineTests.hs +5/−1
- test/Text/Jira/ParserTests.hs +14/−1
- test/Text/Jira/PrinterTests.hs +5/−1
- test/jira-wiki-markup-test.hs +1/−1
CHANGELOG.md view
@@ -4,6 +4,19 @@ `jira-wiki-markup` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +1.5.0+-----++Released 2023-01-11.++* Relaxed upper bounds for mtl, allow mtl 2.3.++* Fixed handling of character sequences that would be interpreted+ as icons if they weren't followed by an alphanumeric character.+ See also [pandoc issue #8511][].++[pandoc issue #8511]: https://github.com/jgm/pandoc/issues/8511+ 1.4.0 -----
LICENSE view
@@ -1,6 +1,6 @@ MIT License -Copyright © 2019–2021 Albert Krewinkel+Copyright © 2019–2023 Albert Krewinkel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.md view
@@ -4,7 +4,7 @@ [![MIT license][License badge]](LICENSE) [![Stackage Lts][Stackage Lts badge]](http://stackage.org/lts/package/jira-wiki-markup) [![Stackage Nightly][Stackage Nightly badge]](http://stackage.org/nightly/package/jira-wiki-markup)-[![Build status][Travis badge]](https://travis-ci.com/tarleb/jira-wiki-markup)+[![GitHub build status][CI badge]][CI workflow] [![Windows build status][AppVeyor badge]](https://ci.appveyor.com/project/tarleb/jira-wiki-markup) This package provides a parser and printer for [Jira wiki markup]. It@@ -14,9 +14,11 @@ [License badge]: https://img.shields.io/badge/license-MIT-blue.svg [Stackage Lts badge]: http://stackage.org/package/jira-wiki-markup/badge/lts [Stackage Nightly badge]: http://stackage.org/package/jira-wiki-markup/badge/nightly-[Travis badge]: https://travis-ci.com/tarleb/jira-wiki-markup.svg?branch=master+[CI badge]: https://img.shields.io/github/actions/workflow/status/pandoc-ext/multibib/ci.yaml?logo=github&branch=main [AppVeyor badge]: https://ci.appveyor.com/api/projects/status/github/tarleb/jira-wiki-markup?branch=master&svg=true [Jira wiki markup]: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all++[CI workflow]: https://github.com/tarleb/jira-wiki-markup/actions/workflows/ci.yaml # License
jira-wiki-markup.cabal view
@@ -1,6 +1,6 @@-cabal-version: 2.0+cabal-version: 2.4 name: jira-wiki-markup-version: 1.4.0+version: 1.5.0 synopsis: Handle Jira wiki markup description: Parse jira wiki text into an abstract syntax tree for easy transformation to other formats.@@ -10,7 +10,7 @@ license-file: LICENSE author: Albert Krewinkel maintainer: tarleb@zeitkraut.de-copyright: © 2019–2021 Albert Krewinkel+copyright: © 2019–2023 Albert Krewinkel category: Text build-type: Simple extra-doc-files: README.md@@ -21,13 +21,39 @@ , GHC == 8.6.5 , GHC == 8.8.3 , GHC == 8.10.4- , GHC == 9.0+ , GHC == 9.0.2+ , GHC == 9.2.5+ , GHC == 9.4.4 source-repository head type: git location: https://github.com/tarleb/jira-wiki-markup.git +common common-options+ build-depends: base >= 4.9 && < 5+ , text >= 1.1.1 && < 1.3 || >= 2.0 && < 2.1+ default-language: Haskell2010+ default-extensions: OverloadedStrings+ ghc-options: -Wall+ -Widentities+ -Wincomplete-record-updates+ -Wincomplete-uni-patterns+ -Wmissing-export-lists+ -Wredundant-constraints+ -Wunused-type-patterns+ if impl(ghc >= 8.2)+ ghc-options: -Wmissing-home-modules+ if impl(ghc >= 8.4)+ ghc-options: -fhide-source-paths+ -Wpartial-fields+ if impl(ghc >= 8.10)+ ghc-options: -Wunused-packages++ if impl(ghc >= 9.0)+ ghc-options: -Winvalid-haddock+ library+ import: common-options hs-source-dirs: src exposed-modules: Text.Jira.Markup , Text.Jira.Parser@@ -38,47 +64,21 @@ , Text.Jira.Parser.Shared , Text.Jira.Printer - build-depends: base >= 4.9 && < 5- , mtl >= 2.2 && < 2.3+ build-depends: mtl >= 2.2 && < 2.4 , parsec >= 3.1 && < 3.2- , text >= 1.1.1 && < 1.3 - ghc-options: -Wall- -Wincomplete-uni-patterns- -Wincomplete-record-updates- -Wcompat- -Widentities- -Wredundant-constraints- if impl(ghc >= 8.4)- ghc-options: -fhide-source-paths - default-language: Haskell2010- default-extensions: OverloadedStrings- executable jira-wiki-markup+ import: common-options hs-source-dirs: app main-is: Main.hs-- build-depends: base >= 4.9 && < 5- , text >= 1.1.1 && < 1.3- , jira-wiki-markup-- ghc-options: -Wall- -threaded+ build-depends: jira-wiki-markup+ ghc-options: -threaded -rtsopts -with-rtsopts=-N- -Wincomplete-uni-patterns- -Wincomplete-record-updates- -Wcompat- -Widentities- -Wredundant-constraints- if impl(ghc >= 8.4)- ghc-options: -fhide-source-paths - default-language: Haskell2010- default-extensions: OverloadedStrings- test-suite jira-wiki-markup-test+ import: common-options type: exitcode-stdio-1.0 hs-source-dirs: test main-is: jira-wiki-markup-test.hs@@ -86,25 +86,10 @@ , Text.Jira.Parser.BlockTests , Text.Jira.Parser.InlineTests , Text.Jira.PrinterTests-- build-depends: base >= 4.9 && < 5- , jira-wiki-markup+ build-depends: jira-wiki-markup , parsec >= 3.1 && < 3.2 , tasty , tasty-hunit- , text >= 1.1.1 && < 1.3-- ghc-options: -Wall- -threaded+ ghc-options: -threaded -rtsopts -with-rtsopts=-N- -Wincomplete-uni-patterns- -Wincomplete-record-updates- -Wcompat- -Widentities- -Wredundant-constraints- if impl(ghc >= 8.4)- ghc-options: -fhide-source-paths-- default-language: Haskell2010- default-extensions: OverloadedStrings
src/Text/Jira/Markup.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE LambdaCase #-} {-| Module : Text.Jira.Markup-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>
src/Text/Jira/Parser.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.Parser-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>
src/Text/Jira/Parser/Block.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.Parser.Block-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>
src/Text/Jira/Parser/Core.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.Parser.Core-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>
src/Text/Jira/Parser/Inline.hs view
@@ -3,7 +3,7 @@ {-# LANGUAGE TupleSections #-} {-| Module : Text.Jira.Parser.Inline-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>@@ -110,7 +110,7 @@ -- | Parses textual representation of an icon into an @'Emoji'@ element. emoji :: JiraParser Inline-emoji = try (Emoji <$> icon <* notFollowedBy' letter <?> "emoji")+emoji = try (Emoji <$> icon <?> "emoji") -- | Parses ASCII representation of en-dash or em-dash. dash :: JiraParser Inline@@ -121,11 +121,15 @@ , pure (Str "–") -- en dash ] <* lookAhead (void (char ' ') <|> eof) --- | Parses a special character symbol as a @Str@.+-- | Parses a special character symbol as a 'SpecialChar'. specialChar :: JiraParser Inline-specialChar = SpecialChar <$> (escapedChar <|> plainSpecialChar)+specialChar = SpecialChar <$> (backslash <|> escapedChar <|> plainSpecialChar) <?> "special char" where+ -- backslash before an icon-sequence that's not an emoji does *not*+ -- work as an escape character.+ backslash = try (char '\\' <* lookAhead (icon' *> alphaNum))+ escapedChar = try (char '\\' *> satisfy isPunctuation) plainSpecialChar = do
src/Text/Jira/Parser/PlainText.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.Parser.PlainText-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>@@ -40,7 +40,7 @@ -- | Escapes text which would otherwise render as an icon. escapeIcon :: Parsec Text u Inline-escapeIcon = Str . ("\\" `append`) . iconText <$> icon+escapeIcon = Str . ("\\" `append`) . iconText <$> try icon plainSpecialChar :: Parsec Text u Inline plainSpecialChar = SpecialChar <$> oneOf specialChars
@@ -1,7 +1,7 @@ {-# LANGUAGE LambdaCase #-} {-| Module : Text.Jira.Parser.Shared-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>@@ -12,6 +12,7 @@ -} module Text.Jira.Parser.Shared ( icon+ , icon' , colorName ) where @@ -22,7 +23,12 @@ -- | Parses an icon icon :: Parsec Text u Icon-icon = smiley <|> otherIcon+icon = icon' <* notFollowedBy alphaNum++-- | Like 'icon', but doesn't check whether the sequence is followed by+-- a character that would prevent the interpretation as an icon.+icon' :: Parsec Text u Icon+icon' = smiley <|> otherIcon smiley :: Parsec Text u Icon smiley = try $ choice
src/Text/Jira/Printer.hs view
@@ -2,7 +2,7 @@ {-# LANGUAGE LambdaCase #-} {-| Module : Text.Jira.Parser-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>
test/Text/Jira/Parser/BlockTests.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.Parser.BlockTests-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>
test/Text/Jira/Parser/InlineTests.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.Parser.InlineTests-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>@@ -405,6 +405,10 @@ , testCase "smiley within word" $ parseJira (normalizeInlines <$> many1 inline) "C:DE" @?= Right [ Str "C", SpecialChar ':', Str "DE" ]++ , testCase "backslash is literal if it's not necessary" $+ parseJira (normalizeInlines <$> many1 inline) "\\:PA" @?=+ Right [ SpecialChar '\\', SpecialChar ':', Str "PA"] , testCase "dash with spaces" $ parseJira (many1 inline) "one -- two" @?=
test/Text/Jira/ParserTests.hs view
@@ -1,6 +1,6 @@ {-| Module : Text.Jira.ParserTests-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>@@ -50,9 +50,22 @@ plainText ":)" @?= Right [Str "\\:)"] + , testCase "smiley and text" $+ plainText ":D lol" @?=+ Right [Str "\\:D", Space, Str "lol"]+ , testCase "icon after word" $ plainText "f(x)" @?= Right [Str "f\\(x)"]++ , testCase "icon-sequence at start of word" $+ plainText ":PA" @?=+ Right [SpecialChar ':', Str "PA"]++ , testCase "icon-sequence followed by digit" $+ plainText ":P2" @?=+ Right [SpecialChar ':', Str "P2"]+ , testCase "special chars" $ plainText "*not strong*" @?=
test/Text/Jira/PrinterTests.hs view
@@ -1,7 +1,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module : Text.Jira.PrinterTests-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>@@ -243,6 +243,10 @@ , testCase "colon is not escaped before space" $ prettyInlines [SpecialChar ':', Space, Str "end"] @?= ": end"++ , testCase "colon is not escaped before non-emoji word" $+ prettyInlines [Space, SpecialChar ':', Str "PA"] @?=+ " :PA" , testCase "closing brace between spaces" $ prettyInlines [Space, SpecialChar '}', Space] @?=
test/jira-wiki-markup-test.hs view
@@ -1,6 +1,6 @@ {-| Module : Main-Copyright : © 2019–2021 Albert Krewinkel+Copyright : © 2019–2023 Albert Krewinkel License : MIT Maintainer : Albert Krewinkel <tarleb@zeitkraut.de>