Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-jira-wiki-markup for
openSUSE:Factory checked in at 2021-06-01 10:39:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-jira-wiki-markup (Old)
and /work/SRC/openSUSE:Factory/.ghc-jira-wiki-markup.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-jira-wiki-markup"
Tue Jun 1 10:39:08 2021 rev:9 rq:896217 version:1.4.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-jira-wiki-markup/ghc-jira-wiki-markup.changes
2021-03-24 16:11:59.519878554 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-jira-wiki-markup.new.1898/ghc-jira-wiki-markup.changes
2021-06-01 10:40:46.057150745 +0200
@@ -1,0 +2,34 @@
+Wed May 26 08:44:37 UTC 2021 - [email protected]
+
+- Update jira-wiki-markup to version 1.4.0.
+ 1.4.0
+ -----
+
+ Released 2021-05-25.
+
+ * Allow quoted image parameters.
+
+ * Added support for "smart links".
+
+ * **API Change**: Add new constructors `SmartCard` and `SmartLink` to
+ Text.Jira.Markup.LinkType.
+
+-------------------------------------------------------------------
+Mon May 24 08:33:30 UTC 2021 - [email protected]
+
+- Update jira-wiki-markup to version 1.3.5.
+ 1.3.5
+ -----
+
+ Released 2021-05-24.
+
+ * Allow spaces and most unicode characters in attachment links.
+
+ * No longer require a newline character after `{noformat}`.
+
+ * Only allow URI path segment characters in bare links.
+
+ * The `file:` schema is no longer allowed in bare links; these
+ rarely make sense.
+
+-------------------------------------------------------------------
Old:
----
jira-wiki-markup-1.3.4.tar.gz
New:
----
jira-wiki-markup-1.4.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-jira-wiki-markup.spec ++++++
--- /var/tmp/diff_new_pack.7X2KQQ/_old 2021-06-01 10:40:46.445151405 +0200
+++ /var/tmp/diff_new_pack.7X2KQQ/_new 2021-06-01 10:40:46.449151412 +0200
@@ -19,7 +19,7 @@
%global pkg_name jira-wiki-markup
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.3.4
+Version: 1.4.0
Release: 0
Summary: Handle Jira wiki markup
License: MIT
++++++ jira-wiki-markup-1.3.4.tar.gz -> jira-wiki-markup-1.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.3.4/CHANGELOG.md
new/jira-wiki-markup-1.4.0/CHANGELOG.md
--- old/jira-wiki-markup-1.3.4/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
+++ new/jira-wiki-markup-1.4.0/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
@@ -4,6 +4,33 @@
`jira-wiki-markup` uses [PVP Versioning][1].
The changelog is available [on GitHub][2].
+1.4.0
+-----
+
+Released 2021-05-25.
+
+* Allow quoted image parameters.
+
+* Added support for "smart links".
+
+* **API Change**: Add new constructors `SmartCard` and `SmartLink` to
+ Text.Jira.Markup.LinkType.
+
+1.3.5
+-----
+
+Released 2021-05-24.
+
+
+* Allow spaces and most unicode characters in attachment links.
+
+* No longer require a newline character after `{noformat}`.
+
+* Only allow URI path segment characters in bare links.
+
+* The `file:` schema is no longer allowed in bare links; these
+ rarely make sense.
+
1.3.4
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.3.4/jira-wiki-markup.cabal
new/jira-wiki-markup-1.4.0/jira-wiki-markup.cabal
--- old/jira-wiki-markup-1.3.4/jira-wiki-markup.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/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.3.4
+version: 1.4.0
synopsis: Handle Jira wiki markup
description: Parse jira wiki text into an abstract syntax tree for easy
transformation to other formats.
@@ -20,7 +20,8 @@
, GHC == 8.4.4
, GHC == 8.6.5
, GHC == 8.8.3
- , GHC == 8.10.1
+ , GHC == 8.10.4
+ , GHC == 9.0
source-repository head
type: git
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.3.4/src/Text/Jira/Markup.hs
new/jira-wiki-markup-1.4.0/src/Text/Jira/Markup.hs
--- old/jira-wiki-markup-1.3.4/src/Text/Jira/Markup.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/src/Text/Jira/Markup.hs 2001-09-09
03:46:40.000000000 +0200
@@ -67,6 +67,8 @@
= Attachment -- ^ link to an attachment
| Email -- ^ link to an email address
| External -- ^ external resource, like a website
+ | SmartCard -- ^ smart-card link (external)
+ | SmartLink -- ^ "smart" link with icon, short-name
| User -- ^ link to a user
deriving (Eq, Ord, Show)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.3.4/src/Text/Jira/Parser/Block.hs
new/jira-wiki-markup-1.4.0/src/Text/Jira/Parser/Block.hs
--- old/jira-wiki-markup-1.3.4/src/Text/Jira/Parser/Block.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/src/Text/Jira/Parser/Block.hs 2001-09-09
03:46:40.000000000 +0200
@@ -183,8 +183,9 @@
-- | Parses a preformatted text into a @NoFormat@ element.
noformat :: JiraParser Block
noformat = try $ do
- (_, params) <- string "{noformat" *> parameters <* char '}' <* newline
- content <- anyChar `manyTill` try (string "{noformat}" *> blankline)
+ (_, params) <- string "{noformat" *> parameters <* char '}'
+ optional newline
+ content <- anyChar `manyTill` try (string "{noformat}" *> optional blankline)
return $ NoFormat params (pack content)
-- | Parses a preformatted text into a @NoFormat@ element.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.3.4/src/Text/Jira/Parser/Inline.hs
new/jira-wiki-markup-1.4.0/src/Text/Jira/Parser/Inline.hs
--- old/jira-wiki-markup-1.3.4/src/Text/Jira/Parser/Inline.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/src/Text/Jira/Parser/Inline.hs 2001-09-09
03:46:40.000000000 +0200
@@ -35,7 +35,7 @@
) where
import Control.Monad (guard, void)
-import Data.Char (isAlphaNum, isPunctuation, ord)
+import Data.Char (isAlphaNum, isAscii, isPunctuation, ord)
#if !MIN_VERSION_base(4,13,0)
import Data.Monoid ((<>), All (..))
#else
@@ -159,8 +159,10 @@
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|{}=!")
+ value = pack <$> (try quotedValue <|> unquotedValue)
comma = char ',' *> skipSpaces
+ quotedValue = char '"' *> manyTill (noneOf "\n\r") (char '"')
+ unquotedValue = many1 (noneOf ",\"'\n\r|{}=!")
-- | Parse link into a @Link@ element.
link :: JiraParser Inline
@@ -169,12 +171,14 @@
withStateFlag (\b st -> st { stateInLink = b }) $ do
_ <- char '['
(alias, sep) <- option ([], '|') . try $ (,) <$> many inline <*> oneOf "^|"
- (linkType, linkURL) <- if sep == '|'
- then (Email,) <$> email <|>
- (External,) <$> url False <|>
- (External,) <$> anchorLink <|>
- (User,) <$> userLink
- else (Attachment,) . URL . pack <$> many1 urlChar
+ (linkType, linkURL) <-
+ if sep == '|'
+ then (Email,) <$> email <|>
+ (External,) <$> anchorLink <|>
+ (User,) <$> userLink <|>
+ externalLink
+ else (Attachment,) . URL . pack <$>
+ many1 (noneOf "\t\r\f\n]|:;/\\")
_ <- char ']'
return $ Link linkType alias linkURL
@@ -186,10 +190,10 @@
where email' = (\(URL e) -> URL ("mailto:" <> e)) <$> email
-- | Parse a URL with scheme @file@, @ftp@, @http@, @https@, @irc@,
--- @nntp@, or @news@.
-url :: Bool -> JiraParser URL
+-- @nntp@, or @news@; ignores @file@ if @isAutoLink@ is false.
+url :: Bool {-^ isAutoLink -} -> JiraParser URL
url isAutoLink = try $ do
- let urlChar' = if isAutoLink then urlChar else urlChar <|> char ' '
+ let urlChar' = if isAutoLink then urlPathChar else urlChar <|> char ' '
urlScheme <- scheme
sep <- pack <$> string "://"
rest <- pack <$> many urlChar'
@@ -198,7 +202,8 @@
scheme = do
first <- letter
case first of
- 'f' -> ("file" <$ string "ile") <|> ("ftp" <$ string "tp")
+ 'f' -> ("file" <$ (guard (not isAutoLink) *> string "ile")) <|>
+ ("ftp" <$ string "tp")
'h' -> string "ttp" *> option "http" ("https" <$ char 's')
'i' -> "irc" <$ string "rc"
'n' -> ("nntp" <$ string "ntp") <|> ("news" <$ string "ews")
@@ -216,6 +221,23 @@
userLink :: JiraParser URL
userLink = URL . pack <$> (char '~' *> many (noneOf "|]\n\r"))
+-- | Parses an external link, i.e., either a plain link to an external
+-- website, or a \"smart\" link or card.
+externalLink :: JiraParser (LinkType, URL)
+externalLink = do
+ url' <- url False
+ mSmartType <- optionMaybe (char '|' *> smartLinkType)
+ return $ case mSmartType of
+ Nothing -> (External, url')
+ Just st -> (st, url')
+
+-- | Finds the type of a "smart" link.
+smartLinkType :: JiraParser LinkType
+smartLinkType = string "smart-" *> choice
+ [ SmartLink <$ string "link"
+ , SmartCard <$ string "card"
+ ]
+
-- | Parses a character which is allowed in URLs
urlChar :: JiraParser Char
urlChar = satisfy $ \case
@@ -223,6 +245,33 @@
'|' -> False -- "|"
x -> ord x > 32 && ord x <= 126 -- excludes space
+-- | Parses a character in an URL path.
+urlPathChar :: JiraParser Char
+urlPathChar = satisfy $ \case
+ '!' -> True
+ '#' -> True
+ '$' -> True
+ '%' -> True
+ '&' -> True
+ '\''-> True
+ '(' -> True
+ ')' -> True
+ '*' -> True
+ '+' -> True
+ ',' -> True
+ '-' -> True
+ '.' -> True
+ '/' -> True
+ ':' -> True
+ ';' -> True
+ '=' -> True
+ '?' -> True
+ '@' -> True
+ '\\'-> True
+ '_' -> True
+ '~' -> True
+ x -> isAlphaNum x && isAscii x
+
--
-- Color
--
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jira-wiki-markup-1.3.4/src/Text/Jira/Printer.hs
new/jira-wiki-markup-1.4.0/src/Text/Jira/Printer.hs
--- old/jira-wiki-markup-1.3.4/src/Text/Jira/Printer.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/src/Text/Jira/Printer.hs 2001-09-09
03:46:40.000000000 +0200
@@ -264,11 +264,15 @@
Attachment -> "[" <> prettyInlines inlines <> "^" <> fromURL url <> "]"
Email -> link' $ "mailto:" <> fromURL url
External -> link' $ fromURL url
+ SmartCard -> smartLink (fromURL url) "smart-card"
+ SmartLink -> smartLink (fromURL url) "smart-link"
User -> link' $ "~" <> fromURL url
where
link' urlText = case inlines of
[] -> "[" <> urlText <> "]"
_ -> "[" <> prettyInlines inlines <> "|" <> urlText <> "]"
+ smartLink urlText smartType =
+ "[" <> prettyInlines inlines <> "|" <> urlText <> "|" <> smartType <> "]"
delimiterChar :: InlineStyle -> Char
delimiterChar = \case
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.3.4/test/Text/Jira/Parser/BlockTests.hs
new/jira-wiki-markup-1.4.0/test/Text/Jira/Parser/BlockTests.hs
--- old/jira-wiki-markup-1.3.4/test/Text/Jira/Parser/BlockTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/test/Text/Jira/Parser/BlockTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -309,6 +309,10 @@
, testCase "with parameters" $
parseJira noformat "{noformat:title=test}\nline 1\nline 2{noformat}\n"
@?=
Right (NoFormat [Parameter "title" "test"] "line 1\nline 2")
+
+ , testCase "without newline" $
+ parseJira noformat "{noformat}raw text{noformat}\n" @?=
+ Right (NoFormat [] "raw text")
]
, testGroup "panel"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.3.4/test/Text/Jira/Parser/InlineTests.hs
new/jira-wiki-markup-1.4.0/test/Text/Jira/Parser/InlineTests.hs
--- old/jira-wiki-markup-1.3.4/test/Text/Jira/Parser/InlineTests.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/test/Text/Jira/Parser/InlineTests.hs
2001-09-09 03:46:40.000000000 +0200
@@ -227,12 +227,19 @@
Right (AutoLink (URL "https://example.org/foo"))
, testCase "link followed by text" $
- parseJira autolink "file:///etc/fstab has passwords" @?=
- Right (AutoLink (URL "file:///etc/fstab"))
+ parseJira autolink "ftp://example.com/passwd has passwords" @?=
+ Right (AutoLink (URL "ftp://example.com/passwd"))
, testCase "email" $
parseJira autolink "mailto:[email protected]" @?=
Right (AutoLink (URL "mailto:[email protected]"))
+
+ , testCase "braces cannot be in bare links" $
+ parseJira autolink "https://example.edu/{*}" @?=
+ Right (AutoLink (URL "https://example.edu/"))
+
+ , testCase "file URIs are not autolinks" $
+ isLeft (parseJira autolink "file:///etc/fstab") @? ""
]
, testGroup "citation"
@@ -277,13 +284,32 @@
Right (Link Email [Str "send", Space, Str "mail"]
(URL "[email protected]"))
- , testCase "attachment link" $
- parseJira link "[testing^test.xml]" @?=
- Right (Link Attachment [Str "testing"] (URL "test.xml"))
-
- , testCase "attachment without description" $
- parseJira link "[^results.txt]" @?=
- Right (Link Attachment [] (URL "results.txt"))
+ , testGroup "attachment link"
+ [ testCase "simple attachment" $
+ parseJira link "[testing^test.xml]" @?=
+ Right (Link Attachment [Str "testing"] (URL "test.xml"))
+
+ , testCase "attachment without description" $
+ parseJira link "[^results.txt]" @?=
+ Right (Link Attachment [] (URL "results.txt"))
+
+ , testCase "filename with space and unicode" $
+ parseJira link "[^Stra??enbahn Berlin.jpg]" @?=
+ Right (Link Attachment [] (URL "Stra??enbahn Berlin.jpg"))
+ ]
+
+ , testGroup "smart links"
+ [ testCase "smart link" $
+ parseJira link "[hslua|https://github.com/hslua/hslua|smart-link]"
@?=
+ Right (Link SmartLink [Str "hslua"]
+ (URL "https://github.com/hslua/hslua"))
+
+ , testCase "smart card" $
+ parseJira link
+ "[repo|https://github.com/tarleb/jira-wiki-markup|smart-card]" @?=
+ Right (Link SmartCard [Str "repo"]
+ (URL "https://github.com/tarleb/jira-wiki-markup"))
+ ]
, testCase "user link" $
parseJira link "[testing|~account-id:something]" @?=
@@ -313,6 +339,11 @@
, Parameter "vspace" "4"
]
in Right (Image params (URL "image.gif"))
+
+ , testCase "quoted parameter" $
+ parseJira image "!foo.jpg|alt=\"some foo!\"!" @?=
+ let params = [ Parameter "alt" "some foo!"]
+ in Right (Image params (URL "foo.jpg"))
]
, testGroup "color"
@@ -343,6 +374,10 @@
, testCase "autolink followed by pipe" $
parseJira (many1 inline) "https://jira.example/file.txt|" @?=
+ Right [AutoLink (URL "https://jira.example/file.txt"), SpecialChar '|']
+
+ , testCase "autolink followed by pipe" $
+ parseJira (many1 inline) "https://jira.example/file.txt|" @?=
Right [AutoLink (URL "https://jira.example/file.txt"), SpecialChar '|']
, testCase "backslash-escaped char" $
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jira-wiki-markup-1.3.4/test/Text/Jira/PrinterTests.hs
new/jira-wiki-markup-1.4.0/test/Text/Jira/PrinterTests.hs
--- old/jira-wiki-markup-1.3.4/test/Text/Jira/PrinterTests.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/jira-wiki-markup-1.4.0/test/Text/Jira/PrinterTests.hs 2001-09-09
03:46:40.000000000 +0200
@@ -177,9 +177,23 @@
renderInline (Link Attachment [] "something.txt") @?=
"[^something.txt]"
+ , testCase "attachment with space and Unicode" $
+ renderInline (Link Attachment [] "??bergang links.txt") @?=
+ "[^??bergang links.txt]"
+
, testCase "user" $
renderInline (Link User [Str "John", Space, Str "Doe"] "ab34-cdef") @?=
"[John Doe|~ab34-cdef]"
+
+ , testCase "smart link" $
+ renderInline (Link SmartLink [Str "repo"]
+ "https://github.com/tarleb/jira-wiki-markup") @?=
+ "[repo|https://github.com/tarleb/jira-wiki-markup|smart-link]"
+
+ , testCase "smart card" $
+ renderInline (Link SmartCard [Str "hslua"]
+ "https://github.com/hslua/hslua") @?=
+ "[hslua|https://github.com/hslua/hslua|smart-card]"
]
, testCase "Styled Emphasis" $