Hello community, here is the log from the commit of package ghc-pandoc-types for openSUSE:Factory checked in at 2018-07-24 17:20:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-pandoc-types (Old) and /work/SRC/openSUSE:Factory/.ghc-pandoc-types.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-pandoc-types" Tue Jul 24 17:20:57 2018 rev:19 rq:623824 version:1.17.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-pandoc-types/ghc-pandoc-types.changes 2018-05-30 12:26:39.375620583 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-pandoc-types.new/ghc-pandoc-types.changes 2018-07-24 17:20:58.959192179 +0200 @@ -1,0 +2,25 @@ +Wed Jul 18 14:26:35 UTC 2018 - psim...@suse.com + +- Cosmetic: replace tabs with blanks, strip trailing white space, + and update copyright headers with spec-cleaner. + +------------------------------------------------------------------- +Fri Jul 13 14:32:07 UTC 2018 - psim...@suse.com + +- Update pandoc-types to version 1.17.5.1. + [1.17.5.1] + + * Declare the ToMetaValue instance for String as OVERLAPPING (#46). + + [1.17.5] + + * Bump upper bounds for aeson, base. + * Allow building on older ghc versions (George Wilson). + * Text.Pandoc.Arbitrary: generate SoftBreaks and LineBreaks + (Alexander Krotov). + * Pad table rows up to maximum row length, to guarantee that + all rows have the same number of columns + (see jgm/pandoc#4059, Francesco Occhipinti). + * Make String an instance of ToMetaValue (Alexander Krotov). + +------------------------------------------------------------------- Old: ---- pandoc-types-1.17.4.2.tar.gz pandoc-types.cabal New: ---- pandoc-types-1.17.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-pandoc-types.spec ++++++ --- /var/tmp/diff_new_pack.jP5bcD/_old 2018-07-24 17:20:59.655193072 +0200 +++ /var/tmp/diff_new_pack.jP5bcD/_new 2018-07-24 17:20:59.659193077 +0200 @@ -19,14 +19,13 @@ %global pkg_name pandoc-types %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.17.4.2 +Version: 1.17.5.1 Release: 0 Summary: Types for representing a structured document License: GPL-2.0-only Group: Development/Libraries/Haskell URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-QuickCheck-devel BuildRequires: ghc-aeson-devel @@ -76,7 +75,6 @@ %prep %setup -q -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ pandoc-types-1.17.4.2.tar.gz -> pandoc-types-1.17.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/Text/Pandoc/Arbitrary.hs new/pandoc-types-1.17.5.1/Text/Pandoc/Arbitrary.hs --- old/pandoc-types-1.17.4.2/Text/Pandoc/Arbitrary.hs 2017-09-13 18:56:09.000000000 +0200 +++ new/pandoc-types-1.17.5.1/Text/Pandoc/Arbitrary.hs 2018-06-10 19:21:52.000000000 +0200 @@ -4,7 +4,8 @@ module Text.Pandoc.Arbitrary () where import Test.QuickCheck -import Control.Monad (forM, liftM, liftM2) +import Control.Applicative (Applicative ((<*>), pure), (<$>)) +import Control.Monad (forM) import Text.Pandoc.Definition import Text.Pandoc.Builder @@ -20,107 +21,88 @@ return (id',classes,keyvals) instance Arbitrary Inlines where - arbitrary = liftM (fromList :: [Inline] -> Inlines) arbitrary + arbitrary = (fromList :: [Inline] -> Inlines) <$> arbitrary instance Arbitrary Blocks where - arbitrary = liftM (fromList :: [Block] -> Blocks) arbitrary + arbitrary = (fromList :: [Block] -> Blocks) <$> arbitrary instance Arbitrary Inline where arbitrary = resize 3 $ arbInline 2 arbInlines :: Int -> Gen [Inline] arbInlines n = listOf1 (arbInline n) `suchThat` (not . startsWithSpace) - where startsWithSpace (Space:_) = True - startsWithSpace _ = False + where startsWithSpace (Space:_) = True + startsWithSpace (SoftBreak:_) = True + -- Note: no LineBreak, similarly to Text.Pandoc.Builder (trimInlines) + startsWithSpace _ = False -- restrict to 3 levels of nesting max; otherwise we get -- bogged down in indefinitely large structures arbInline :: Int -> Gen Inline -arbInline n = frequency $ [ (60, liftM Str realString) - , (60, return Space) - , (10, liftM2 Code arbAttr realString) +arbInline n = frequency $ [ (60, Str <$> realString) + , (40, pure Space) + , (10, pure SoftBreak) + , (10, pure LineBreak) + , (10, Code <$> arbAttr <*> realString) , (5, elements [ RawInline (Format "html") "<a id=\"eek\">" , RawInline (Format "latex") "\\my{command}" ]) ] ++ [ x | x <- nesters, n > 1] - where nesters = [ (10, liftM Emph $ arbInlines (n-1)) - , (10, liftM Strong $ arbInlines (n-1)) - , (10, liftM Strikeout $ arbInlines (n-1)) - , (10, liftM Superscript $ arbInlines (n-1)) - , (10, liftM Subscript $ arbInlines (n-1)) - , (10, liftM SmallCaps $ arbInlines (n-1)) - , (10, do x1 <- arbAttr - x2 <- arbInlines (n-1) - return $ Span x1 x2) - , (10, do x1 <- arbitrary - x2 <- arbInlines (n-1) - return $ Quoted x1 x2) - , (10, do x1 <- arbitrary - x2 <- realString - return $ Math x1 x2) - , (10, do x0 <- arbAttr - x1 <- arbInlines (n-1) - x3 <- realString - x2 <- realString - return $ Link x0 x1 (x2,x3)) - , (10, do x0 <- arbAttr - x1 <- arbInlines (n-1) - x3 <- realString - x2 <- realString - return $ Image x0 x1 (x2,x3)) - , (2, liftM2 Cite arbitrary (arbInlines 1)) - , (2, liftM Note $ resize 3 $ listOf1 $ arbBlock (n-1)) + where nesters = [ (10, Emph <$> arbInlines (n-1)) + , (10, Strong <$> arbInlines (n-1)) + , (10, Strikeout <$> arbInlines (n-1)) + , (10, Superscript <$> arbInlines (n-1)) + , (10, Subscript <$> arbInlines (n-1)) + , (10, SmallCaps <$> arbInlines (n-1)) + , (10, Span <$> arbAttr <*> arbInlines (n-1)) + , (10, Quoted <$> arbitrary <*> arbInlines (n-1)) + , (10, Math <$> arbitrary <*> realString) + , (10, Link <$> arbAttr <*> arbInlines (n-1) <*> ((,) <$> realString <*> realString)) + , (10, Image <$> arbAttr <*> arbInlines (n-1) <*> ((,) <$> realString <*> realString)) + , (2, Cite <$> arbitrary <*> arbInlines 1) + , (2, Note <$> resize 3 (listOf1 $ arbBlock (n-1))) ] instance Arbitrary Block where arbitrary = resize 3 $ arbBlock 2 arbBlock :: Int -> Gen Block -arbBlock n = frequency $ [ (10, liftM Plain $ arbInlines (n-1)) - , (15, liftM Para $ arbInlines (n-1)) - , (5, liftM2 CodeBlock arbAttr realString) - , (3, liftM LineBlock $ - liftM2 (:) - (arbInlines $ (n - 1) `mod` 3) - (forM [1..((n - 1) `div` 3)] - (const $ arbInlines 3))) +arbBlock n = frequency $ [ (10, Plain <$> arbInlines (n-1)) + , (15, Para <$> arbInlines (n-1)) + , (5, CodeBlock <$> arbAttr <*> realString) + , (3, LineBlock <$> + ((:) <$> + arbInlines ((n - 1) `mod` 3) <*> + forM [1..((n - 1) `div` 3)] (const (arbInlines 3)))) , (2, elements [ RawBlock (Format "html") "<div>\n*&*\n</div>" , RawBlock (Format "latex") "\\begin[opt]{env}\nhi\n{\\end{env}" ]) - , (5, do x1 <- choose (1 :: Int, 6) - x2 <- arbInlines (n-1) - return (Header x1 nullAttr x2)) - , (2, return HorizontalRule) + , (5, Header <$> choose (1 :: Int, 6) + <*> pure nullAttr + <*> arbInlines (n-1)) + , (2, pure HorizontalRule) ] ++ [x | x <- nesters, n > 0] - where nesters = [ (5, liftM BlockQuote $ listOf1 $ arbBlock (n-1)) - , (5, do x2 <- arbitrary - x3 <- arbitrary - x1 <- arbitrary `suchThat` (> 0) - x4 <- listOf1 $ listOf1 $ arbBlock (n-1) - return $ OrderedList (x1,x2,x3) x4 ) - , (5, liftM BulletList $ (listOf1 $ listOf1 $ arbBlock (n-1))) - , (5, do items <- listOf1 $ do - x1 <- listOf1 $ listOf1 $ arbBlock (n-1) - x2 <- arbInlines (n-1) - return (x2,x1) - return $ DefinitionList items) - , (5, do x1 <- arbAttr - x2 <- listOf1 $ arbBlock (n-1) - return $ Div x1 x2) + where nesters = [ (5, BlockQuote <$> listOf1 (arbBlock (n-1))) + , (5, OrderedList <$> ((,,) <$> (arbitrary `suchThat` (> 0)) + <*> arbitrary + <*> arbitrary) + <*> listOf1 (listOf1 $ arbBlock (n-1))) + , (5, BulletList <$> listOf1 (listOf1 $ arbBlock (n-1))) + , (5, DefinitionList <$> listOf1 ((,) <$> arbInlines (n-1) + <*> listOf1 (listOf1 $ arbBlock (n-1)))) + , (5, Div <$> arbAttr <*> listOf1 (arbBlock (n-1))) , (2, do rs <- choose (1 :: Int, 4) cs <- choose (1 :: Int, 4) - x1 <- arbInlines (n-1) - x2 <- vector cs - x3 <- vectorOf cs $ elements [0, 0.25] - x4 <- vectorOf cs $ listOf $ arbBlock (n-1) - x5 <- vectorOf rs $ vectorOf cs - $ listOf $ arbBlock (n-1) - return (Table x1 x2 x3 x4 x5)) + Table <$> arbInlines (n-1) + <*> vector cs + <*> vectorOf cs (elements [0, 0.25]) + <*> vectorOf cs (listOf $ arbBlock (n-1)) + <*> vectorOf rs (vectorOf cs $ listOf $ arbBlock (n-1))) ] instance Arbitrary Pandoc where - arbitrary = resize 8 $ liftM2 Pandoc arbitrary arbitrary + arbitrary = resize 8 (Pandoc <$> arbitrary <*> arbitrary) instance Arbitrary CitationMode where arbitrary @@ -133,13 +115,12 @@ instance Arbitrary Citation where arbitrary - = do x1 <- listOf $ elements $ ['a'..'z'] ++ ['0'..'9'] ++ ['_'] - x2 <- arbInlines 1 - x3 <- arbInlines 1 - x4 <- arbitrary - x5 <- arbitrary - x6 <- arbitrary - return (Citation x1 x2 x3 x4 x5 x6) + = Citation <$> listOf (elements $ ['a'..'z'] ++ ['0'..'9'] ++ ['_']) + <*> arbInlines 1 + <*> arbInlines 1 + <*> arbitrary + <*> arbitrary + <*> arbitrary instance Arbitrary MathType where arbitrary @@ -160,7 +141,7 @@ instance Arbitrary Meta where arbitrary = do (x1 :: Inlines) <- arbitrary - (x2 :: [Inlines]) <- liftM (filter (not . isNull)) arbitrary + (x2 :: [Inlines]) <- filter (not . isNull) <$> arbitrary (x3 :: Inlines) <- arbitrary return $ setMeta "title" x1 $ setMeta "author" x2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/Text/Pandoc/Builder.hs new/pandoc-types-1.17.5.1/Text/Pandoc/Builder.hs --- old/pandoc-types-1.17.4.2/Text/Pandoc/Builder.hs 2018-03-16 23:31:24.000000000 +0100 +++ new/pandoc-types-1.17.5.1/Text/Pandoc/Builder.hs 2018-06-12 20:56:59.000000000 +0200 @@ -277,6 +277,9 @@ instance ToMetaValue Bool where toMetaValue = MetaBool +instance {-# OVERLAPPING #-} ToMetaValue String where + toMetaValue = MetaString + instance ToMetaValue a => ToMetaValue [a] where toMetaValue = MetaList . map toMetaValue @@ -474,21 +477,19 @@ horizontalRule :: Blocks horizontalRule = singleton HorizontalRule +-- | Table builder. Rows and headers will be padded or truncated to the size of +-- @cellspecs@ table :: Inlines -- ^ Caption -> [(Alignment, Double)] -- ^ Column alignments and fractional widths -> [Blocks] -- ^ Headers -> [[Blocks]] -- ^ Rows -> Blocks table caption cellspecs headers rows = singleton $ - Table (toList caption) aligns widths - (map toList headers') (map (map toList) rows) + Table (toList caption) aligns widths (sanitise headers) (map sanitise rows) where (aligns, widths) = unzip cellspecs - numcols = case (headers:rows) of - [] -> 0 - xs -> maximum (map length xs) - headers' = if null headers - then replicate numcols mempty - else headers + sanitise = map toList . pad mempty numcols + numcols = length cellspecs + pad element upTo list = take upTo (list ++ repeat element) -- | A simple table without a caption. simpleTable :: [Blocks] -- ^ Headers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/Text/Pandoc/Definition.hs new/pandoc-types-1.17.5.1/Text/Pandoc/Definition.hs --- old/pandoc-types-1.17.4.2/Text/Pandoc/Definition.hs 2018-03-16 20:23:37.000000000 +0100 +++ new/pandoc-types-1.17.5.1/Text/Pandoc/Definition.hs 2018-06-10 19:21:52.000000000 +0200 @@ -84,7 +84,7 @@ #if MIN_VERSION_base(4,8,0) import Control.DeepSeq #else -import Data.Monoid +import Data.Monoid (Monoid (mappend, mempty)) import Control.Applicative ((<$>), (<*>)) import Control.DeepSeq.Generics #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/Text/Pandoc/Walk.hs new/pandoc-types-1.17.5.1/Text/Pandoc/Walk.hs --- old/pandoc-types-1.17.4.2/Text/Pandoc/Walk.hs 2018-03-16 23:30:53.000000000 +0100 +++ new/pandoc-types-1.17.5.1/Text/Pandoc/Walk.hs 2018-06-10 19:21:52.000000000 +0200 @@ -93,14 +93,14 @@ module Text.Pandoc.Walk (Walkable(..)) where -import Control.Applicative () +import Control.Applicative (Applicative ((<*>), pure), (<$>)) import Control.Monad ((>=>)) import Data.Functor.Identity (Identity (runIdentity)) import Text.Pandoc.Definition import qualified Data.Traversable as T -import Data.Traversable () +import Data.Traversable (Traversable) import qualified Data.Foldable as F -import Data.Foldable () +import Data.Foldable (Foldable) #if MIN_VERSION_base(4,8,0) import Data.Monoid ((<>)) #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/changelog new/pandoc-types-1.17.5.1/changelog --- old/pandoc-types-1.17.4.2/changelog 2018-03-16 23:35:49.000000000 +0100 +++ new/pandoc-types-1.17.5.1/changelog 2018-06-13 01:07:10.000000000 +0200 @@ -1,3 +1,19 @@ +[1.17.5.1] + + * Declare the ToMetaValue instance for String as OVERLAPPING (#46). + +[1.17.5] + + + * Bump upper bounds for aeson, base. + * Allow building on older ghc versions (George Wilson). + * Text.Pandoc.Arbitrary: generate SoftBreaks and LineBreaks + (Alexander Krotov). + * Pad table rows up to maximum row length, to guarantee that + all rows have the same number of columns + (see jgm/pandoc#4059, Francesco Occhipinti). + * Make String an instance of ToMetaValue (Alexander Krotov). + [1.17.4.2] * Fix compiler warnings. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/pandoc-types.cabal new/pandoc-types-1.17.5.1/pandoc-types.cabal --- old/pandoc-types-1.17.4.2/pandoc-types.cabal 2018-03-16 23:34:49.000000000 +0100 +++ new/pandoc-types-1.17.5.1/pandoc-types.cabal 2018-06-13 01:06:31.000000000 +0200 @@ -1,5 +1,5 @@ Name: pandoc-types -Version: 1.17.4.2 +Version: 1.17.5.1 Synopsis: Types for representing a structured document Description: @Text.Pandoc.Definition@ defines the 'Pandoc' data structure, which is used by pandoc to represent @@ -46,12 +46,12 @@ Text.Pandoc.JSON Text.Pandoc.Arbitrary Other-modules: Paths_pandoc_types - Build-depends: base >= 4 && < 5, + Build-depends: base >= 4.5 && < 5, containers >= 0.3, syb >= 0.1 && < 0.8, ghc-prim >= 0.2, bytestring >= 0.9 && < 0.11, - aeson >= 0.6.2 && < 1.4, + aeson >= 0.6.2 && < 1.5, transformers >= 0.2 && < 0.6, QuickCheck >= 2 if !impl(ghc >= 8.0) @@ -69,7 +69,7 @@ build-depends: base, pandoc-types, syb, - aeson >= 0.6.2 && < 1.4, + aeson >= 0.6.2 && < 1.5, containers >= 0.3, bytestring >= 0.9 && < 0.11, test-framework >= 0.3 && < 0.9, @@ -85,6 +85,6 @@ main-is: bench.hs hs-source-dirs: benchmark build-depends: pandoc-types, - base >= 4.2 && < 5, + base >= 4.5 && < 5, criterion >= 1.0 && < 1.5 ghc-options: -rtsopts -Wall -fno-warn-unused-do-bind -O2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pandoc-types-1.17.4.2/test/test-pandoc-types.hs new/pandoc-types-1.17.5.1/test/test-pandoc-types.hs --- old/pandoc-types-1.17.4.2/test/test-pandoc-types.hs 2017-10-26 19:38:06.000000000 +0200 +++ new/pandoc-types-1.17.5.1/test/test-pandoc-types.hs 2018-06-11 19:36:42.000000000 +0200 @@ -3,6 +3,7 @@ import Text.Pandoc.Arbitrary () import Text.Pandoc.Definition import Text.Pandoc.Walk +import Text.Pandoc.Builder (singleton, plain, text, simpleTable) import Data.Generics import Data.List (tails) import Test.HUnit (Assertion, assertEqual, assertFailure) @@ -362,6 +363,25 @@ t_null :: (Block, ByteString) t_null = (Null, [s|{"t":"Null"}|]) +-- headers and rows are padded to a consistent number of +-- cells in order to avoid syntax errors after conversion, see +-- jgm/pandoc#4059. +t_tableSan :: Test +t_tableSan = testCase "table sanitisation" $ assertion + where assertion = assertEqual err expected generated + err = "sanitisation error" + generated = simpleTable + [plain (text "foo"), plain (text "bar")] + [[mempty] + ,[]] + expected = singleton (Table + [] + [AlignDefault, AlignDefault] + [0.0, 0.0] + [[Plain [Str "foo"]], + [Plain [Str "bar"]]] + [[[], []], [[], []]]) + tests :: [Test] tests = @@ -438,7 +458,8 @@ , testEncodeDecode "Null" t_null ] ] - ] + ], + t_tableSan ]