jira-wiki-markup 1.5.0 → 1.5.1
raw patch · 4 files changed
+16/−3 lines, 4 filesdep ~textPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: text
API changes (from Hackage documentation)
Files
- CHANGELOG.md +7/−0
- jira-wiki-markup.cabal +1/−1
- src/Text/Jira/Parser/Inline.hs +4/−2
- test/Text/Jira/Parser/InlineTests.hs +4/−0
CHANGELOG.md view
@@ -4,6 +4,13 @@ `jira-wiki-markup` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +1.5.1+-----++Released 2023-03-13.++* Parser: Disallow image paths that start with a space.+ 1.5.0 -----
jira-wiki-markup.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: jira-wiki-markup-version: 1.5.0+version: 1.5.1 synopsis: Handle Jira wiki markup description: Parse jira wiki text into an abstract syntax tree for easy transformation to other formats.
src/Text/Jira/Parser/Inline.hs view
@@ -35,7 +35,7 @@ ) where import Control.Monad (guard, void)-import Data.Char (isAlphaNum, isAscii, isPunctuation, ord)+import Data.Char (isAlphaNum, isAscii, isPunctuation, isSpace, ord) #if !MIN_VERSION_base(4,13,0) import Data.Monoid ((<>), All (..)) #else@@ -155,7 +155,9 @@ image :: JiraParser Inline image = try $ do -- does not use @url@, as is may contain relative locations.- src <- char '!' *> (URL . pack <$> many1 (noneOf "\r\t\n|]!"))+ src <- char '!'+ *> lookAhead (satisfy $ not . isSpace)+ *> (URL . pack <$> many1 (noneOf "\r\t\n|]!")) params <- option [] (char '|' *> (thumbnail <|> imgParams `sepBy` comma)) _ <- char '!' return $ Image params src
test/Text/Jira/Parser/InlineTests.hs view
@@ -344,6 +344,10 @@ parseJira image "!foo.jpg|alt=\"some foo!\"!" @?= let params = [ Parameter "alt" "some foo!"] in Right (Image params (URL "foo.jpg"))++ , testCase "first character cannot be a space" $+ isLeft (parseJira image "! foo.jpg!") @?+ "An image cannot start with a space." ] , testGroup "color"