Hello community,
here is the log from the commit of package ghc-jira-wiki-markup for
openSUSE:Leap:15.2 checked in at 2020-05-18 11:00:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/ghc-jira-wiki-markup (Old)
and /work/SRC/openSUSE:Leap:15.2/.ghc-jira-wiki-markup.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-jira-wiki-markup"
Mon May 18 11:00:05 2020 rev:2 rq:806120 version:1.1.4
Changes:
--------
---
/work/SRC/openSUSE:Leap:15.2/ghc-jira-wiki-markup/ghc-jira-wiki-markup.changes
2020-02-09 11:26:05.107321705 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.ghc-jira-wiki-markup.new.2738/ghc-jira-wiki-markup.changes
2020-05-18 11:00:06.302724718 +0200
@@ -1,0 +2,9 @@
+Wed May 6 06:54:10 UTC 2020 - [email protected]
+
+- Update jira-wiki-markup to version 1.1.4.
+ Upstream has edited the change log file since the last release in
+ a non-trivial way, i.e. they did more than just add a new entry
+ at the top. You can review the file at:
+ http://hackage.haskell.org/package/jira-wiki-markup-1.1.4/src/CHANGELOG.md
+
+-------------------------------------------------------------------
Old:
----
jira-wiki-markup-1.0.0.tar.gz
New:
----
jira-wiki-markup-1.1.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-jira-wiki-markup.spec ++++++
--- /var/tmp/diff_new_pack.nyBHkB/_old 2020-05-18 11:00:06.710725562 +0200
+++ /var/tmp/diff_new_pack.nyBHkB/_new 2020-05-18 11:00:06.714725570 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-jira-wiki-markup
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name jira-wiki-markup
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.0.0
+Version: 1.1.4
Release: 0
Summary: Handle Jira wiki markup
License: MIT
@@ -53,8 +53,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-echo > Setup.hs 'import Distribution.Simple'
-echo >>Setup.hs 'main = defaultMain'
%build
%ghc_lib_build
++++++ jira-wiki-markup-1.0.0.tar.gz -> jira-wiki-markup-1.1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/CHANGELOG.md
new/jira-wiki-markup-1.1.4/CHANGELOG.md
--- old/jira-wiki-markup-1.0.0/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
+++ new/jira-wiki-markup-1.1.4/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
@@ -1,10 +1,62 @@
-# Changelog
+Changelog
+=========
`jira-wiki-markup` uses [PVP Versioning][1].
The changelog is available [on GitHub][2].
+1.1.4
+-----
+
+Released 2020-03-27
+
+* Fix parsing of image parameters. Thumbnails and images with
+ parameters were previously not recognized as images.
+
+1.1.3
+-----
+
+Released 2020-03-19
+
+* Fixed table detection in endOfParagraph parser: Tables were
+ expected to have a space between the leading pipe(s) and the
+ cell content. Lines like `||Name|` were erroneously not
+ recognized as the beginning of a new block.
+
+1.1.2
+-----
+
+Released 2020-03-18
+
+* Don't escape colon/semicolon unless necessary: it is necessary
+ to escape colons or semicolons only if they could otherwise
+ become part of a smiley.
+
+1.1.1
+-----
+
+Released 2020-03-18
+
+* Colon `:` and semicolon `;` are now parsed as special
+ characters, since they can be the first characters of an emoji.
+* Fixed parsing of words which contain non-special symbol
+ characters: word boundaries were not set correctly if a word
+ contained a dot `.` or similar chars.
+* Fixed incorrect emphasis parsing: digits were erroneously
+ allows as the first characters after closing emphasis
+ characters.
+
+1.1.0
+-----
+
+Released 2020-03-13.
+
+* Lists are now allowed to be indented; i.e., lists are still recognized
+ if list markers are preceded by spaces.
+* Support for colored inlines has been added.
+* New constructor `ColorInline` for type `Inline` (API change).
+
1.0.0
-=====
+-----
Released 2019-12-17.
@@ -19,7 +71,7 @@
- blocks of colored text are parsed as `Color`;
- interpretation of special characters as markup can be forced by
surrounding them with curly braces.
-* A parser `plainText` was added available to read markup-less text.
+* A parser `plainText` was made available to read markup-less text.
* *Inline*-parser `symbol` was renamed to `specialChar`.
* Add printer module to render the document AST as Jira markup.
* Markup datatype changes:
@@ -32,12 +84,12 @@
* CI runs also test GHC 8.8.
0.1.1
-=====
+-----
* Ensure proper parsing of backslash-escaped characters.
0.1.0
-=====
+-----
* Initially created.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/LICENSE
new/jira-wiki-markup-1.1.4/LICENSE
--- old/jira-wiki-markup-1.0.0/LICENSE 2001-09-09 03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/LICENSE 2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019 Albert Krewinkel
+Copyright © 2019–2020 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/jira-wiki-markup.cabal
new/jira-wiki-markup-1.1.4/jira-wiki-markup.cabal
--- old/jira-wiki-markup-1.0.0/jira-wiki-markup.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/jira-wiki-markup.cabal 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
cabal-version: 2.0
name: jira-wiki-markup
-version: 1.0.0
+version: 1.1.4
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: [email protected]
-copyright: © 2019 Albert Krewinkel
+copyright: © 2019–2020 Albert Krewinkel
category: Text
build-type: Simple
extra-doc-files: README.md
@@ -18,8 +18,8 @@
tested-with: GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
- , GHC == 8.6.4
- , GHC == 8.8.1
+ , GHC == 8.6.5
+ , GHC == 8.8.3
source-repository head
type: git
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/src/Text/Jira/Markup.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Markup.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Markup.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Markup.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-|
Module : Text.Jira.Markup
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -37,6 +37,7 @@
data Inline
= Anchor Text -- ^ anchor for internal links
| AutoLink URL -- ^ URL which is also a link
+ | ColorInline ColorName [Inline] -- ^ colored inline text
| Emoji Icon -- ^ emoticon
| Entity Text -- ^ named or numeric HTML entity
| Image [Parameter] URL -- ^ an image
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Block.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Block.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Block.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Block.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.Parser.Block
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -88,7 +88,7 @@
_ -> error ("the impossible happened: unknown style for bullet " ++
[c])
atDepth :: Int -> JiraParser ()
- atDepth depth = try . void $ count depth anyBulletMarker
+ atDepth depth = try $ skipSpaces <* count depth anyBulletMarker
firstItemAtDepth :: Int -> JiraParser [Block]
firstItemAtDepth depth = try $ listContent (depth + 1) <|>
@@ -113,7 +113,9 @@
nonListContent :: Int -> JiraParser [Block]
nonListContent depth = try $
- let nonListBlock = notFollowedBy' (many1 (oneOf "#-*")) *> block
+ let nonListBlock = do
+ notFollowedBy' (skipSpaces *> many1 (oneOf "#-*"))
+ block
in char ' ' *> do
first <- block
nonList <- many nonListBlock
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Core.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Core.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Core.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Core.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.Parser.Core
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -114,8 +114,8 @@
<|> lookAhead panelStart
where
headerStart = void $ char 'h' *> oneOf "123456" <* char '.'
- listItemStart = void $ many1 (oneOf "#*-") <* char ' '
- tableStart = void $ skipSpaces *> many1 (char '|') *> char ' '
+ listItemStart = void $ skipSpaces *> many1 (oneOf "#*-") <* char ' '
+ tableStart = void $ skipSpaces *> many1 (char '|')
panelStart = void $ char '{' *> choice (map (try . string) blockNames)
horizontalRule = void $ try (string "----") *> blankline
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Inline.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Inline.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Inline.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Inline.hs 2001-09-09
03:46:40.000000000 +0200
@@ -2,7 +2,7 @@
{-# LANGUAGE LambdaCase #-}
{-|
Module : Text.Jira.Parser.Inline
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -11,12 +11,12 @@
Parse Jira wiki inline markup.
-}
-
module Text.Jira.Parser.Inline
( inline
-- * Inline component parsers
, anchor
, autolink
+ , colorInline
, dash
, emoji
, entity
@@ -33,7 +33,7 @@
) where
import Control.Monad (guard, void)
-import Data.Char (isLetter, isPunctuation, ord)
+import Data.Char (isAlphaNum, isPunctuation, ord)
#if !MIN_VERSION_base(4,13,0)
import Data.Monoid ((<>), All (..))
#else
@@ -57,6 +57,7 @@
, link
, image
, styled
+ , colorInline
, monospaced
, anchor
, entity
@@ -67,7 +68,7 @@
-- | Characters which, depending on context, can have a special meaning.
specialChars :: String
-specialChars = "_+-*^~|[]{}(!&\\"
+specialChars = "_+-*^~|[]{}(!&\\:;"
-- | Parses an in-paragraph newline as a @Linebreak@ element. Both newline
-- characters and double-backslash are recognized as line-breaks.
@@ -84,12 +85,14 @@
-- | Parses a simple, markup-less string into a @Str@ element.
str :: JiraParser Inline
-str = Str . pack <$> (alphaNums <|> otherNonSpecialChars) <?> "string"
+str = Str . pack . mconcat
+ <$> many1 (alphaNums <|> otherNonSpecialChars)
+ <?> "string"
where
nonStrChars = " \n" ++ specialChars
alphaNums = many1 alphaNum <* updateLastStrPos
- otherNonSpecialChars = many1 (noneOf nonStrChars)
-
+ otherNonSpecialChars = many1 . satisfy $ \c ->
+ not (isAlphaNum c || c `elem` nonStrChars)
-- | Parses an HTML entity into an @'Entity'@ element.
entity :: JiraParser Inline
@@ -143,9 +146,15 @@
image = try $ do
-- does not use @url@, as is may contain relative locations.
src <- char '!' *> (URL . pack <$> many1 (noneOf "\r\t\n|]!"))
- (_, params) <- option (Nothing, []) (char '|' *> parameters)
+ params <- option [] (char '|' *> (thumbnail <|> imgParams `sepBy` comma))
_ <- char '!'
return $ Image params src
+ where
+ thumbnail = [Parameter "thumbnail" ""] <$ try (string "thumbnail")
+ imgParams = try (Parameter <$> key <*> (char '=' *> value))
+ key = pack <$> many1 (noneOf ",\"'\t\n\r |{}=!")
+ value = pack <$> many1 (noneOf ",\"'\n\r|{}=!")
+ comma = char ',' *> skipSpaces
-- | Parse link into a @Link@ element.
link :: JiraParser Inline
@@ -189,6 +198,19 @@
urlChar = satisfy $ \c ->
c `notElem` ("|]" :: String) && ord c >= 32 && ord c <= 127
+--
+-- Color
+--
+
+-- | Text in a different color.
+colorInline :: JiraParser Inline
+colorInline = try $ do
+ name <- string "{color:" *> (colorName <|> colorCode) <* char '}'
+ content <- inline `manyTill` try (string "{color}")
+ return $ ColorInline (ColorName $ pack name) content
+ where
+ colorName = many1 letter
+ colorCode = (:) <$> option '#' (char '#') <*> count 6 digit
--
-- Markup
@@ -244,4 +266,4 @@
opening *> notFollowedBy space *> manyTill parser closing'
where
closing' = try $ closing <* lookAhead wordBoundary
- wordBoundary = void (satisfy (not . isLetter)) <|> eof
+ wordBoundary = void (satisfy (not . isAlphaNum)) <|> eof
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/PlainText.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/PlainText.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/PlainText.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/PlainText.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.Parser.PlainText
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Shared.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Shared.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser/Shared.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser/Shared.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-|
Module : Text.Jira.Parser.Shared
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Parser.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Parser.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.Parser
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/src/Text/Jira/Printer.hs
new/jira-wiki-markup-1.1.4/src/Text/Jira/Printer.hs
--- old/jira-wiki-markup-1.0.0/src/Text/Jira/Printer.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/src/Text/Jira/Printer.hs 2001-09-09
03:46:40.000000000 +0200
@@ -2,7 +2,7 @@
{-# LANGUAGE LambdaCase #-}
{-|
Module : Text.Jira.Parser
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -56,6 +56,12 @@
(renderInline s `T.snoc` c) <> prettyInlines rest
s@Linebreak : SpecialChar c : rest@(Space {}:_) ->
(renderInline s `T.snoc` c) <> prettyInlines rest
+ -- Colon and semicolon only need escaping if they could otherwise
+ -- become part of a smiley.
+ SpecialChar c : rest@(x : _) | c `elem` [':', ';'] && not (isSmileyStr x) ->
+ T.singleton c <> prettyInlines rest
+ [SpecialChar c] | c `elem` [':', ';'] ->
+ T.singleton c
(x:xs) ->
renderInline x <> prettyInlines xs
@@ -63,6 +69,9 @@
startsWithAlphaNum t = case T.uncons t of
Just (c, _) -> isAlphaNum c
_ -> False
+ isSmileyStr = \case
+ Str x | x `elem` ["D", ")", "(", "P"] -> True
+ _ -> False
-- | Internal state used by the printer.
data PrinterState = PrinterState
@@ -213,6 +222,8 @@
renderInline = \case
Anchor name -> "{anchor:" <> name <> "}"
AutoLink url -> urlText url
+ ColorInline color ils -> "{color:" <> colorText color <> "}" <>
+ prettyInlines ils <> "{color}"
Emoji icon -> iconText icon
Entity entity -> "&" <> entity <> ";"
Image params url -> "!" <> urlText url <>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.0.0/test/Text/Jira/Parser/BlockTests.hs
new/jira-wiki-markup-1.1.4/test/Text/Jira/Parser/BlockTests.hs
--- old/jira-wiki-markup-1.0.0/test/Text/Jira/Parser/BlockTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/test/Text/Jira/Parser/BlockTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.Parser.BlockTests
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -193,6 +193,21 @@
, List CircleBullets [[Para [Str "drei"]]]
]
])
+
+ , testCase "indentation is ignored" $
+ let text = Text.unlines
+ [ " * One"
+ , " * Two"
+ , " ** Two.One"
+ , " * Three"
+ ]
+ in parseJira list text @?=
+ Right (List CircleBullets
+ [ [ Para [Str "One"] ]
+ , [ Para [Str "Two"]
+ , List CircleBullets [[Para [Str "Two.One"]]]]
+ , [ Para [Str "Three"] ]
+ ])
]
, testGroup "Table"
@@ -358,6 +373,14 @@
Right ( List CircleBullets [[Para [Str "foo"]]]
, List CircleBullets [[Para [Str "bar"]]])
+ , testCase "para before table" $
+ parseJira ((,) <$> block <*> block) "tabletest\n||Name|\n|Test|\n" @?=
+ Right ( Para [Str "tabletest"]
+ , Table [ Row [HeaderCell [Para [Str "Name"]]]
+ , Row [BodyCell [Para [Str "Test"]]]
+ ]
+ )
+
, testCase "para after table" $
parseJira ((,) <$> block <*> block) "|| point |\nhuh\n" @?=
Right ( Table [Row [HeaderCell [Para [Str "point"]]]]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.0.0/test/Text/Jira/Parser/InlineTests.hs
new/jira-wiki-markup-1.1.4/test/Text/Jira/Parser/InlineTests.hs
--- old/jira-wiki-markup-1.0.0/test/Text/Jira/Parser/InlineTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/test/Text/Jira/Parser/InlineTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.Parser.InlineTests
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -29,11 +29,14 @@
parseJira str "word" @?= Right (Str "word")
, testCase "non-special symbols" $
- parseJira str ",.;#%" @?= Right (Str ",.;#%")
+ parseJira str ",.#%" @?= Right (Str ",.#%")
, testCase "umlauts" $
parseJira str "äéíöüßðå" @?= Right (Str "äéíöüßðå")
+ , testCase "mix of alphanums and non-special chars" $
+ parseJira str "20.09" @?= Right (Str "20.09")
+
, testCase "space fails" $
isLeft (parseJira str " ") @?
"str should only be parsed into Space"
@@ -249,6 +252,31 @@
, testCase "no newlines" $
isLeft (parseJira image "!hello\nworld.png!") @?
"no newlines in image names"
+
+ , testCase "thumbnail" $
+ parseJira image "!image.png|thumbnail!" @?=
+ Right (Image [Parameter "thumbnail" ""] (URL "image.png"))
+
+ , testCase "parameters" $
+ parseJira image "!image.gif|align=right, vspace=4!" @?=
+ let params = [ Parameter "align" "right"
+ , Parameter "vspace" "4"
+ ]
+ in Right (Image params (URL "image.gif"))
+ ]
+
+ , testGroup "color"
+ [ testCase "colored word" $
+ parseJira colorInline "{color:red}red{color}" @?=
+ Right (ColorInline (ColorName "red") [Str "red"])
+
+ , testCase "hex color" $
+ parseJira colorInline "{color:#526487}blueish{color}" @?=
+ Right (ColorInline (ColorName "#526487") [Str "blueish"])
+
+ , testCase "hex color without hash" $
+ parseJira colorInline "{color:526487}blueish{color}" @?=
+ Right (ColorInline (ColorName "#526487") [Str "blueish"])
]
]
@@ -269,7 +297,8 @@
, testCase "backslash-escaped char" $
parseJira (normalizeInlines <$> many1 inline) "opening brace: \\{" @?=
- Right [Str "opening", Space, Str "brace:", Space, SpecialChar '{']
+ Right [ Str "opening", Space, Str "brace", SpecialChar ':', Space
+ , SpecialChar '{']
, testCase "icon after word" $
parseJira (many1 inline) "checkmark(/)" @?=
@@ -285,15 +314,30 @@
, testCase "smiley between words" $
parseJira (normalizeInlines <$> many1 inline) "verdict: :D funny" @?=
- Right [Str "verdict:", Space, Emoji IconSmiling, Space, Str "funny"]
+ Right [ Str "verdict", SpecialChar ':', Space
+ , Emoji IconSmiling, Space, Str "funny"]
, testCase "dash with spaces" $
parseJira (many1 inline) "one -- two" @?=
Right [Str "one", Space, Str "–", Space, Str "two"]
-
, testCase "forced markup" $
parseJira (many1 inline) "H{~}2{~}O" @?=
Right [Str "H", Styled Subscript [Str "2"], Str "O"]
+
+ , testCase "color in sentence" $
+ parseJira (many1 inline) "This is {color:red}red{color}." @?=
+ Right [ Str "This", Space, Str "is", Space
+ , ColorInline (ColorName "red") [Str "red"]
+ , Str "."
+ ]
+
+ , testCase "hypen between numbers" $
+ -- the hypens used to be treated as deletion markers.
+ parseJira (many1 inline) "-15 02-3" @?=
+ Right [ SpecialChar '-', Str "15" , Space, Str "02"
+ , SpecialChar '-', Str "3"
+ ]
+
]
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/test/Text/Jira/ParserTests.hs
new/jira-wiki-markup-1.1.4/test/Text/Jira/ParserTests.hs
--- old/jira-wiki-markup-1.0.0/test/Text/Jira/ParserTests.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/test/Text/Jira/ParserTests.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.ParserTests
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.0.0/test/Text/Jira/PrinterTests.hs
new/jira-wiki-markup-1.1.4/test/Text/Jira/PrinterTests.hs
--- old/jira-wiki-markup-1.0.0/test/Text/Jira/PrinterTests.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/test/Text/Jira/PrinterTests.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Text.Jira.PrinterTests
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -126,6 +126,11 @@
, testCase "Styled Strong" $
renderInline (Styled Strong [Str "Hello,", Space, Str "World!"]) @?=
"*Hello, World!*"
+
+ , testCase "Colored inlines" $
+ renderInline (ColorInline (ColorName "red")
+ [Str "This", Space, Str "is", Space, Str "red."]) @?=
+ "{color:red}This is red.{color}"
]
, testGroup "combined inlines"
@@ -144,6 +149,24 @@
, testCase "markup followed by punctuation" $
prettyInlines [Styled Emphasis [Str "Word"], Str "."] @?=
"_Word_."
+
+ , testCase "colon as last character" $
+ prettyInlines [Str "end", SpecialChar ':'] @?=
+ "end:"
+
+ , testCase "semicolon is escaped before close paren" $
+ -- would be treated as "winking smiley" otherwise
+ prettyInlines [SpecialChar ';', Str ")"] @?=
+ "\\;)"
+
+ , testCase "colon is not escaped before space" $
+ prettyInlines [SpecialChar ':', Space, Str "end"] @?=
+ ": end"
+
+ , testCase "colon not escaped before opening paren" $
+ -- escaping the paren is enough
+ prettyInlines [SpecialChar ':', SpecialChar '('] @?=
+ ":\\("
]
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.0.0/test/jira-wiki-markup-test.hs
new/jira-wiki-markup-1.1.4/test/jira-wiki-markup-test.hs
--- old/jira-wiki-markup-1.0.0/test/jira-wiki-markup-test.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.1.4/test/jira-wiki-markup-test.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-|
Module : Main
-Copyright : © 2019 Albert Krewinkel
+Copyright : © 2019–2020 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>