Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-pandoc-lua-marshal for
openSUSE:Factory checked in at 2022-08-01 21:31:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-pandoc-lua-marshal (Old)
and /work/SRC/openSUSE:Factory/.ghc-pandoc-lua-marshal.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-pandoc-lua-marshal"
Mon Aug 1 21:31:39 2022 rev:3 rq:990835 version:0.1.7
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-pandoc-lua-marshal/ghc-pandoc-lua-marshal.changes
2022-02-25 21:25:36.983644139 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-pandoc-lua-marshal.new.1533/ghc-pandoc-lua-marshal.changes
2022-08-01 21:32:23.766000246 +0200
@@ -1,0 +2,33 @@
+Sat Jul 16 13:29:37 UTC 2022 - Peter Simons <[email protected]>
+
+- Update pandoc-lua-marshal to version 0.1.7.
+ ## 0.1.7
+
+ Released 2022-07-16.
+
+ - Allow Blocks to be passed as Caption value. The resulting
+ caption has the Blocks as its long version and no short
+ version.
+
+ - Add `clone` method to Pandoc elements.
+
+-------------------------------------------------------------------
+Fri Jun 10 10:13:58 UTC 2022 - Peter Simons <[email protected]>
+
+- Update pandoc-lua-marshal to version 0.1.6.1.
+ 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/pandoc-lua-marshal-0.1.6.1/src/CHANGELOG.md
+
+-------------------------------------------------------------------
+Sat Feb 19 14:49:24 UTC 2022 - Peter Simons <[email protected]>
+
+- Update pandoc-lua-marshal to version 0.1.5.1.
+ ## 0.1.5.1
+
+ Release pending.
+
+ - Relax upper bound for lua and hslua.
+
+-------------------------------------------------------------------
Old:
----
pandoc-lua-marshal-0.1.5.tar.gz
New:
----
pandoc-lua-marshal-0.1.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-pandoc-lua-marshal.spec ++++++
--- /var/tmp/diff_new_pack.USUOwy/_old 2022-08-01 21:32:24.194001474 +0200
+++ /var/tmp/diff_new_pack.USUOwy/_new 2022-08-01 21:32:24.202001497 +0200
@@ -19,7 +19,7 @@
%global pkg_name pandoc-lua-marshal
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.5
+Version: 0.1.7
Release: 0
Summary: Use pandoc types in Lua
License: MIT
++++++ pandoc-lua-marshal-0.1.5.tar.gz -> pandoc-lua-marshal-0.1.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pandoc-lua-marshal-0.1.5/CHANGELOG.md
new/pandoc-lua-marshal-0.1.7/CHANGELOG.md
--- old/pandoc-lua-marshal-0.1.5/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
+++ new/pandoc-lua-marshal-0.1.7/CHANGELOG.md 2001-09-09 03:46:40.000000000
+0200
@@ -2,6 +2,43 @@
`pandoc-lua-marshal` uses [PVP Versioning][].
+## 0.1.7
+
+Released 2022-07-16.
+
+- Allow Blocks to be passed as Caption value. The resulting
+ caption has the Blocks as its long version and no short
+ version.
+
+- Add `clone` method to Pandoc elements.
+
+## 0.1.6.1
+
+Released 2022-06-10.
+
+- Provide better error messages when fuzzy retrieval of Inlines
+ or Blocks fails.
+
+- Relax upper bound for text, allow text-2.0.
+
+## 0.1.6
+
+Released 2022-06-03.
+
+- Fix `applyFully`: the function always traversed the document
+ type-wise, never topdown.
+
+- Avoid shadowing of a function name that was added in
+ hslua-2.2.
+
+- Support concatenating of Pandoc values with the `..` operator.
+
+## 0.1.5.1
+
+Released 2022-02-19.
+
+- Relax upper bound for lua and hslua.
+
## 0.1.5
Released 2022-02-17.
@@ -10,7 +47,7 @@
functions `filter`, `map`, and `find_if`. These previously
required the argument to be of type `function`, which was too
restrictive.
-
+
- Inline: the type of Image captions is now `Inlines` instead
of `List`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pandoc-lua-marshal-0.1.5/pandoc-lua-marshal.cabal
new/pandoc-lua-marshal-0.1.7/pandoc-lua-marshal.cabal
--- old/pandoc-lua-marshal-0.1.5/pandoc-lua-marshal.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/pandoc-lua-marshal.cabal 2001-09-09
03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: pandoc-lua-marshal
-version: 0.1.5
+version: 0.1.7
synopsis: Use pandoc types in Lua
description: This package provides functions to marshal and unmarshal
pandoc document types to and from Lua.
@@ -19,7 +19,7 @@
license-file: LICENSE
author: Albert Krewinkel, John MacFarlane
maintainer: Albert Krewinkel <[email protected]>
-copyright: ?? 2017-2021 Albert Krewinkel, John MacFarlane
+copyright: ?? 2017-2022 Albert Krewinkel, John MacFarlane
category: Foreign
build-type: Simple
extra-doc-files: README.md
@@ -27,8 +27,8 @@
tested-with: GHC == 8.6.5
GHC == 8.8.4
GHC == 8.10.7
- GHC == 9.0.1
- GHC == 9.2.1
+ GHC == 9.0.2
+ GHC == 9.2.3
extra-source-files: test/test-attr.lua
, test/test-block.lua
, test/test-cell.lua
@@ -49,12 +49,12 @@
, bytestring >= 0.10 && < 0.12
, containers >= 0.6 && < 0.7
, exceptions >= 0.8 && < 0.11
- , lua >= 2.1 && < 2.2
- , hslua >= 2.1 && < 2.2
- , hslua-marshalling >= 2.1 && < 2.2
+ , lua >= 2.1 && < 2.3
+ , hslua >= 2.1 && < 2.3
+ , hslua-marshalling >= 2.1 && < 2.3
, pandoc-types >= 1.22.1 && < 1.23
, safe >= 0.3 && < 0.4
- , text >= 1.1.1.0 && < 1.3
+ , text >= 1.1.1.0 && < 1.3 || >= 2.0
&& < 2.1
ghc-options: -Wall
-Wcompat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/AST.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/AST.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/AST.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/AST.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
{- |
-Copyright: (c) 2021 Albert Krewinkel
+Copyright: (c) 2021-2022 Albert Krewinkel
SPDX-License-Identifier: MIT
Maintainer: Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Alignment.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Alignment.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Alignment.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Alignment.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Block.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Block.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Block.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Block.hs
2001-09-09 03:46:40.000000000 +0200
@@ -45,7 +45,7 @@
( peekListAttributes, pushListAttributes )
import Text.Pandoc.Lua.Marshal.Shared (walkBlocksAndInlines)
import Text.Pandoc.Lua.Marshal.TableParts
- ( peekCaption, pushCaption
+ ( peekCaptionFuzzy, pushCaption
, peekColSpec, pushColSpec
, peekTableBody, pushTableBody
, peekTableFoot, pushTableFoot
@@ -90,20 +90,22 @@
-- bare strings as @Str@ values.
peekBlockFuzzy :: LuaError e
=> Peeker e Block
-peekBlockFuzzy = choice
- [ peekBlock
- , \idx -> Plain <$!> peekInlinesFuzzy idx
- ]
+peekBlockFuzzy idx =
+ peekBlock idx
+ <|> (Plain <$!> peekInlinesFuzzy idx)
+ <|> (failPeek =<<
+ typeMismatchMessage "Block or list of Inlines" idx)
{-# INLINABLE peekBlockFuzzy #-}
-- | Try extra-hard to return the value at the given index as a list of
-- inlines.
peekBlocksFuzzy :: LuaError e
=> Peeker e [Block]
-peekBlocksFuzzy = choice
- [ peekList peekBlockFuzzy
- , (<$!>) pure . peekBlockFuzzy
- ]
+peekBlocksFuzzy idx =
+ peekList peekBlockFuzzy idx
+ <|> (pure <$!> peekBlockFuzzy idx)
+ <|> (failPeek =<<
+ typeMismatchMessage "Block, list of Blocks, or compatible element" idx)
{-# INLINABLE peekBlocksFuzzy #-}
-- | Block object type.
@@ -141,7 +143,7 @@
_ -> const Absent)
, possibleProperty "caption" "element caption"
(pushCaption, \case {Table _ capt _ _ _ _ -> Actual capt; _ -> Absent})
- (peekCaption, \case
+ (peekCaptionFuzzy, \case
Table attr _ cs h bs f -> Actual . (\c -> Table attr c cs h bs f)
_ -> const Absent)
, possibleProperty "colspecs" "column alignments and widths"
@@ -373,7 +375,7 @@
let attr = fromMaybe nullAttr mattr
in return $! attr `seq` capt `seq` colspecs `seq` thead `seq`
tbodies
`seq` tfoot `seq` Table attr capt colspecs thead tbodies tfoot)
- <#> parameter peekCaption "Caption" "caption" "table caption"
+ <#> parameter peekCaptionFuzzy "Caption" "caption" "table caption"
<#> parameter (peekList peekColSpec) "{ColSpec,...}" "colspecs"
"column alignments and widths"
<#> parameter peekTableHead "TableHead" "head" "table head"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Cell.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Cell.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Cell.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Cell.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Citation.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Citation.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Citation.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Citation.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/CitationMode.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/CitationMode.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/CitationMode.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/CitationMode.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Content.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Content.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Content.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Content.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Filter.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Filter.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Filter.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Filter.hs
2001-09-09 03:46:40.000000000 +0200
@@ -3,7 +3,7 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Format.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Format.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Format.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Format.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Inline.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Inline.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Inline.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Inline.hs
2001-09-09 03:46:40.000000000 +0200
@@ -25,7 +25,7 @@
, walkInlinesStraight
) where
-import Control.Applicative (optional)
+import Control.Applicative ((<|>), optional)
import Control.Monad.Catch (throwM)
import Control.Monad ((<$!>))
import Data.Data (showConstr, toConstr)
@@ -93,10 +93,10 @@
=> Peeker e [Inline]
peekInlinesFuzzy idx = liftLua (ltype idx) >>= \case
TypeString -> B.toList . B.text <$> peekText idx
- _ -> choice
- [ peekList peekInlineFuzzy
- , fmap pure . peekInlineFuzzy
- ] idx
+ _ -> peekList peekInlineFuzzy idx
+ <|> (pure <$> peekInlineFuzzy idx)
+ <|> (failPeek =<<
+ typeMismatchMessage "Inline, list of Inlines, or string" idx)
{-# INLINABLE peekInlinesFuzzy #-}
-- | Inline object type.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Inline.hs-boot
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Inline.hs-boot
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Inline.hs-boot
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Inline.hs-boot
2001-09-09 03:46:40.000000000 +0200
@@ -1,9 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE TypeApplications #-}
-{-# LANGUAGE TupleSections #-}
module Text.Pandoc.Lua.Marshal.Inline
( -- * Single Inline elements
peekInline
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/List.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/List.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/List.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/List.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/ListAttributes.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/ListAttributes.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/ListAttributes.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/ListAttributes.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/MathType.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/MathType.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/MathType.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/MathType.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/MetaValue.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/MetaValue.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/MetaValue.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/MetaValue.hs
2001-09-09 03:46:40.000000000 +0200
@@ -3,7 +3,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Pandoc.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Pandoc.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Pandoc.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Pandoc.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -20,12 +20,10 @@
) where
import Control.Applicative (optional)
-import Control.Monad ((<$!>), (>=>))
+import Control.Monad ((<$!>))
import Data.Maybe (fromMaybe)
import HsLua
-import Text.Pandoc.Lua.Marshal.Block
- (peekBlocksFuzzy, pushBlocks, walkBlockSplicing, walkBlocksStraight)
-import Text.Pandoc.Lua.Marshal.Inline (walkInlineSplicing, walkInlinesStraight)
+import Text.Pandoc.Lua.Marshal.Block (peekBlocksFuzzy, pushBlocks)
import Text.Pandoc.Lua.Marshal.Filter
import Text.Pandoc.Lua.Marshal.MetaValue (peekMetaValue, pushMetaValue)
import Text.Pandoc.Lua.Marshal.Shared (walkBlocksAndInlines)
@@ -43,7 +41,12 @@
-- | Pandoc object type.
typePandoc :: LuaError e => DocumentedType e Pandoc
typePandoc = deftype "Pandoc"
- [ operation Eq $ defun "__eq"
+ [ operation Concat $ lambda
+ ### liftPure2 (<>)
+ <#> parameter peekPandoc "Pandoc" "a" ""
+ <#> parameter peekPandoc "Pandoc" "b" ""
+ =#> functionResult pushPandoc "Pandoc" "combined documents"
+ , operation Eq $ defun "__eq"
### liftPure2 (\a b -> fromMaybe False ((==) <$> a <*> b))
<#> parameter (optional . peekPandoc) "doc1" "pandoc" ""
<#> parameter (optional . peekPandoc) "doc2" "pandoc" ""
@@ -60,14 +63,13 @@
(pushMeta, \(Pandoc meta _) -> meta)
(peekMeta, \(Pandoc _ blks) meta -> Pandoc meta blks)
+ , method $ defun "clone"
+ ### return
+ <#> parameter peekPandoc "Pandoc" "doc" "self"
+ =#> functionResult pushPandoc "Pandoc" "cloned Pandoc document"
+
, method $ defun "walk"
- ### (\doc filter' -> case filterWalkingOrder filter' of
- WalkForEachType -> walkBlocksAndInlines filter' doc
- >>= applyMetaFunction filter'
- >>= applyPandocFunction filter'
- WalkTopdown -> applyPandocFunction filter' doc
- >>= applyMetaFunction filter'
- >>= walkBlocksAndInlines filter')
+ ### flip applyFully
<#> parameter peekPandoc "Pandoc" "self" ""
<#> parameter peekFilter "Filter" "lua_filter" "table of filter functions"
=#> functionResult pushPandoc "Pandoc" "modified element"
@@ -134,10 +136,10 @@
applyFully :: LuaError e
=> Filter
-> Pandoc -> LuaE e Pandoc
-applyFully filter' =
- walkInlineSplicing filter'
- >=> walkInlinesStraight filter'
- >=> walkBlockSplicing filter'
- >=> walkBlocksStraight filter'
- >=> applyMetaFunction filter'
- >=> applyPandocFunction filter'
+applyFully filter' doc = case filterWalkingOrder filter' of
+ WalkForEachType -> walkBlocksAndInlines filter' doc
+ >>= applyMetaFunction filter'
+ >>= applyPandocFunction filter'
+ WalkTopdown -> applyPandocFunction filter' doc
+ >>= applyMetaFunction filter'
+ >>= walkBlocksAndInlines filter'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/QuoteType.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/QuoteType.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/QuoteType.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/QuoteType.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Row.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Row.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Row.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Row.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Shared.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Shared.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/Shared.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/Shared.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/SimpleTable.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/SimpleTable.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/SimpleTable.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/SimpleTable.hs
2001-09-09 03:46:40.000000000 +0200
@@ -2,7 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/TableFoot.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/TableFoot.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/TableFoot.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/TableFoot.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/TableHead.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/TableHead.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/TableHead.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/TableHead.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/TableParts.hs
new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/TableParts.hs
--- old/pandoc-lua-marshal-0.1.5/src/Text/Pandoc/Lua/Marshal/TableParts.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/src/Text/Pandoc/Lua/Marshal/TableParts.hs
2001-09-09 03:46:40.000000000 +0200
@@ -1,7 +1,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{- |
-Copyright : ?? 2021 Albert Krewinkel
+Copyright : ?? 2021-2022 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer : Albert Krewinkel <[email protected]>
@@ -10,6 +10,7 @@
-}
module Text.Pandoc.Lua.Marshal.TableParts
( peekCaption
+ , peekCaptionFuzzy
, pushCaption
, peekColSpec
, pushColSpec
@@ -28,7 +29,7 @@
, mkTableHead
) where
-import Control.Applicative (optional)
+import Control.Applicative ((<|>), optional)
import Control.Monad ((<$!>))
import HsLua
import Text.Pandoc.Lua.Marshal.Alignment (peekAlignment, pushAlignment)
@@ -52,11 +53,18 @@
-- | Peek Caption element
peekCaption :: LuaError e => Peeker e Caption
-peekCaption = retrieving "Caption" . \idx -> do
+peekCaption idx = do
short <- optional $ peekFieldRaw peekInlinesFuzzy "short" idx
long <- peekFieldRaw peekBlocksFuzzy "long" idx
return $! Caption short long
+peekCaptionFuzzy :: LuaError e => Peeker e Caption
+peekCaptionFuzzy = retrieving "Caption" . \idx -> do
+ peekCaption idx
+ <|> (Caption Nothing <$!> peekBlocksFuzzy idx)
+ <|> (failPeek =<<
+ typeMismatchMessage "Caption, list of Blocks, or compatible element"
idx)
+
-- | Push a ColSpec value as a pair of Alignment and ColWidth.
pushColSpec :: LuaError e => Pusher e ColSpec
pushColSpec = pushPair pushAlignment pushColWidth
@@ -99,7 +107,7 @@
-- | Add a value to the table at the top of the stack at a string-index.
addField :: LuaError e => Name -> LuaE e () -> LuaE e ()
-addField key pushValue = do
+addField key pushFieldValue = do
pushName key
- pushValue
+ pushFieldValue
rawset (nth 3)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pandoc-lua-marshal-0.1.5/test/test-block.lua
new/pandoc-lua-marshal-0.1.7/test/test-block.lua
--- old/pandoc-lua-marshal-0.1.5/test/test-block.lua 2001-09-09
03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/test/test-block.lua 2001-09-09
03:46:40.000000000 +0200
@@ -319,7 +319,23 @@
Table({long = {}}, {}, TableHead(), {}, new_foot),
tbl
)
- end)
+ end),
+ test('caption field accepts list of blocks', function ()
+ local caption = {long = {Plain 'cap'}}
+ local tbl = Table(caption, {}, TableHead(), {}, TableFoot())
+ assert.are_same(tbl.caption, {long = {Plain 'cap'}})
+
+ tbl.caption = {Plain 'extended'}
+
+ local new_caption = {
+ short = nil,
+ long = {Plain 'extended'}
+ }
+ assert.are_equal(
+ Table(new_caption, {}, TableHead(), {}, TableFoot()),
+ tbl
+ )
+ end),
},
},
group "Blocks" {
@@ -349,6 +365,12 @@
{'Header', 'CodeBlock'}
)
end),
+ test('gives sensible error message', function ()
+ assert.error_matches(
+ function() Blocks(nil) end,
+ 'Block, list of Blocks, or compatible element expected'
+ )
+ end)
},
group 'walk' {
test('modifies Inline subelements', function ()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pandoc-lua-marshal-0.1.5/test/test-inline.lua
new/pandoc-lua-marshal-0.1.7/test/test-inline.lua
--- old/pandoc-lua-marshal-0.1.5/test/test-inline.lua 2001-09-09
03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/test/test-inline.lua 2001-09-09
03:46:40.000000000 +0200
@@ -318,6 +318,12 @@
{'Str', 'Space', 'Str'}
)
end),
+ test('gives sensible error message', function ()
+ assert.error_matches(
+ function() Inlines(nil) end,
+ "Inline, list of Inlines, or string"
+ )
+ end)
},
group 'walk' {
test('modifies Inline subelements', function ()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pandoc-lua-marshal-0.1.5/test/test-pandoc.lua
new/pandoc-lua-marshal-0.1.7/test/test-pandoc.lua
--- old/pandoc-lua-marshal-0.1.5/test/test-pandoc.lua 2001-09-09
03:46:40.000000000 +0200
+++ new/pandoc-lua-marshal-0.1.7/test/test-pandoc.lua 2001-09-09
03:46:40.000000000 +0200
@@ -35,6 +35,31 @@
assert.are_same(meta.zahlen, {'eins', 'zwei', 'drei'})
end),
},
+ group 'operations' {
+ test('concatenation', function ()
+ local doc1 = Pandoc({Para 'Lovely'}, {title='first'})
+ local doc2 = Pandoc({Para 'Day'}, {title='second'})
+ assert.are_equal(
+ Pandoc({Para 'Lovely', Para 'Day'}, {title='second'}),
+ doc1 .. doc2
+ )
+ end)
+ },
+ group 'clone' {
+ test('cloned value is equal to original', function ()
+ local doc = Pandoc({'test'}, {foo = 'hi'})
+ assert.are_same(doc, doc:clone())
+ end),
+ test('changing the clone does not affect original', function ()
+ local orig = Pandoc({'test'}, {foo = 'hi'})
+ local copy = orig:clone()
+
+ copy.blocks[1] = Plain 'different'
+ assert.are_same(orig.meta, copy.meta)
+ assert.are_same(Blocks{'test'}, orig.blocks)
+ assert.are_same(Blocks{'different'}, copy.blocks)
+ end),
+ },
group 'walk' {
test('uses `Meta` function', function ()
local meta = {