pandoc-crossref 0.3.15.0 → 0.3.15.1
raw patch · 5 files changed
+29/−28 lines, 5 filesdep ~pandocPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: pandoc
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs +11/−11
- pandoc-crossref.cabal +7/−7
- test/m2m/label-precedence/expect.md +1/−1
- test/m2m/subfigures-grid/expect.md +6/−9
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.3.15.1++- Do not copy image attributes to implicit figure element+ ## 0.3.15.0 - Update demos
lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs view
@@ -128,7 +128,7 @@ blkToRow x = [x] inlToCell :: Inline -> Maybe Block inlToCell (Image (id', cs, as) txt tgt) = Just $- Figure (id', cs, as) (Caption Nothing [Para txt]) [Plain [Image ("", cs, setW as) txt tgt]]+ Figure (id', cs, []) (Caption Nothing [Para txt]) [Plain [Image ("", cs, setW as) txt tgt]] inlToCell _ = Nothing setW as = ("width", "100%"):filter ((/="width") . fst) as @@ -144,8 +144,9 @@ imageToFigure :: Inline -> Maybe Block imageToFigure = \case- Image (label,cls,attrs) alt tgt -> Just $ Figure (label, cls, attrs) (Caption Nothing [Para alt])- [Plain [Image ("",cls,attrs) alt tgt]]+ Image (label,cls,attrs) alt tgt -> Just $+ Figure (label, cls, []) (Caption Nothing [Para alt])+ [Plain [Image ("",cls,attrs) alt tgt]] _ -> Nothing replaceSubfig :: Inline -> WS [Inline]@@ -156,10 +157,9 @@ idxStr <- replaceAttr label' (lookup "label" attrs) alt imgRefs let alt' = applyTemplate idxStr alt $ figureTemplate opts case outFormat opts of- f | isLatexFormat f ->- pure $ latexSubFigure x label- _ -> return [Image (label, cls, setLabel opts idxStr attrs) alt' tgt]-replaceSubfig x = return [x]+ f | isLatexFormat f -> pure $ latexSubFigure x label+ _ -> pure [Image (label, cls, setLabel opts idxStr attrs) alt' tgt]+replaceSubfig x = pure [x] latexSubFigure :: Inline -> T.Text -> [Inline] latexSubFigure (Image (_, cls, attrs) alt (src, title)) label =@@ -203,9 +203,9 @@ opts <- ask let label' = normalizeLabel label let title = blocksToInlines [btitle]- attrs = fromMaybe fattrs $ case blocksToInlines content of- [Image (_, _, as) _ _] -> Just as- _ -> Nothing+ attrs = case blocksToInlines content of+ [Image (_, _, as) _ _] -> fattrs <> as+ _ -> fattrs idxStr <- replaceAttr label' (lookup "label" attrs) title imgRefs let title' = case outFormat opts of f | isLatexFormat f -> title@@ -214,5 +214,5 @@ replaceNoRecurse $ if subFigure && isLatexFormat (outFormat opts) then Plain $ latexSubFigure (head $ blocksToInlines content) label- else Figure (label,cls,setLabel opts idxStr attrs) caption' content+ else Figure (label,cls,setLabel opts idxStr fattrs) caption' content runFigure _ _ _ _ = noReplaceNoRecurse
pandoc-crossref.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: pandoc-crossref-version: 0.3.15.0+version: 0.3.15.1 synopsis: Pandoc filter for cross-references description: pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them. category: Text@@ -127,7 +127,7 @@ build-depends: base >=4.11 && <5 , mtl >=1.1 && <2.4- , pandoc ==3.0.*+ , pandoc >=3.0 && <3.2 , pandoc-crossref-internal , pandoc-types , text >=1.2.2 && <2.1@@ -170,7 +170,7 @@ , microlens-mtl >=0.2.0.1 && <0.3.0.0 , microlens-th >=0.4.3.10 && <0.5.0.0 , mtl >=1.1 && <2.3- , pandoc ==3.0.*+ , pandoc >=3.0 && <3.2 , pandoc-types , syb >=0.4 && <0.8 , template-haskell >=2.7.0.0 && <3.0.0.0@@ -191,7 +191,7 @@ , gitrev >=1.3.1 && <1.4 , open-browser ==0.2.* , optparse-applicative >=0.13 && <0.18- , pandoc ==3.0.*+ , pandoc >=3.0 && <3.2 , pandoc-crossref , pandoc-types , template-haskell >=2.7.0.0 && <3.0.0.0@@ -212,7 +212,7 @@ , directory >=1 && <1.4 , filepath >=1.1 && <1.5 , hspec >=2.4.4 && <3- , pandoc ==3.0.*+ , pandoc >=3.0 && <3.2 , pandoc-crossref , pandoc-types , text >=1.2.2 && <2.1@@ -238,7 +238,7 @@ , hspec >=2.4.4 && <3 , microlens >=0.4.12.0 && <0.5.0.0 , mtl >=1.1 && <2.3- , pandoc ==3.0.*+ , pandoc >=3.0 && <3.2 , pandoc-crossref , pandoc-crossref-internal , pandoc-types@@ -258,7 +258,7 @@ build-depends: base >=4.11 && <5 , criterion >=1.5.9.0 && <1.7- , pandoc ==3.0.*+ , pandoc >=3.0 && <3.2 , pandoc-crossref , pandoc-types , text >=1.2.2 && <2.1
test/m2m/label-precedence/expect.md view
@@ -14,7 +14,7 @@ other text -::: {#fig:fig2 .figure label="+"}+::: {#fig:fig2 .figure} {label="+"} ::: caption
test/m2m/subfigures-grid/expect.md view
@@ -2,9 +2,8 @@ ::: {#fig:subfigures .figure .subfigures} +:------------------:+:------------------:+:------------------:+-| :: | :: | ::: {.f |-| : {#fig:subfig1 .f | : {#fig:subfig2 .f | igure width="30%"} |-| igure width="30%"} | igure width="30%"} | {width="100%"} | | png){width="100%"} | png){width="100%"} | | | | | ::: caption |@@ -13,9 +12,8 @@ | ::: | ::: | ::: | | ::: | ::: | | +--------------------+--------------------+--------------------+-| :: | ::: {.f | :: |-| : {#fig:subfig4 .f | igure width="30%"} | : {#fig:subfig6 .f |-| igure width="30%"} | {width="100%"} | {width="100%"} | | png){width="100%"} | | | ::: caption | |@@ -24,9 +22,8 @@ | ::: | ::: | ::: | | ::: | | ::: | +--------------------+--------------------+--------------------+-| :: | ::: {.f | :: |-| : {#fig:subfig7 .f | igure width="30%"} | : {#fig:subfig9 .f |-| igure width="30%"} | {width="100%"} | {width="100%"} | | png){width="100%"} | | | ::: caption | |