diff options
| author | John MacFarlane <[email protected]> | 2023-07-05 12:44:57 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-07-05 12:44:57 -0700 |
| commit | d3e485fcb0841240df7991d85a764a5b8e701985 (patch) | |
| tree | 291d2b48d6d41e3216b02f80c904726aa209d0a7 | |
| parent | e09c560256e2c637e69866e1449f126d244d0f0d (diff) | |
Use latest dev typst-hs.
| -rw-r--r-- | cabal.project | 2 | ||||
| -rw-r--r-- | src/Text/Pandoc/Readers/Typst.hs | 16 | ||||
| -rw-r--r-- | stack.yaml | 2 |
3 files changed, 3 insertions, 17 deletions
diff --git a/cabal.project b/cabal.project index 9ba5ed46d..0a8b373ba 100644 --- a/cabal.project +++ b/cabal.project @@ -15,6 +15,6 @@ source-repository-package source-repository-package type: git location: https://github.com/jgm/typst-hs - tag: cd2583f638033cdedda2460642c93315fbc11979 + tag: be9e946616b1564106255a4de7e69a70c5be848b -- when time for a release: -- Release new skylighting, skylighting-core and depend on them diff --git a/src/Text/Pandoc/Readers/Typst.hs b/src/Text/Pandoc/Readers/Typst.hs index 4b828615b..bff232722 100644 --- a/src/Text/Pandoc/Readers/Typst.hs +++ b/src/Text/Pandoc/Readers/Typst.hs @@ -44,7 +44,7 @@ import Text.TeXMath (writeTeX) import Text.TeXMath.Shared (getSpaceChars) import Text.Pandoc.Readers.Typst.Math (pMathMany) import Text.Pandoc.Readers.Typst.Parsing (pTok, ignored, chunks, getField, P) -import Typst.Methods (applyPureFunction, formatNumber) +import Typst.Methods (formatNumber, applyPureFunction) import Typst.Types -- import Debug.Trace @@ -309,12 +309,6 @@ handleBlock tok = do pure $ B.plain . B.text . mconcat . map toNum $ V.toList nums Elt "footnote.entry" _ fields -> getField "body" fields >>= pWithContents pBlocks - Elt "style" _ fields -> do - Function f <- getField "func" fields - case applyPureFunction (Function f) [VStyles] of - Success (VContent cs) -> pWithContents pBlocks cs - Success x -> pure $ B.para $ B.text $ repr x - Failure e -> fail e Elt (Identifier tname) _ _ -> do ignored ("unknown block element " <> tname) pure mempty @@ -335,7 +329,6 @@ pParBreak = isInline :: Content -> Bool isInline (Lab {}) = True isInline (Txt {}) = True -isInline (Elt "style" _ _) = True -- can be block or inline isInline (Elt "place" _ _) = True -- can be block or inline isInline (Elt "align" _ _) = True -- can be block or inline isInline x = not (isBlock x) @@ -383,7 +376,6 @@ isBlock (Elt name _ fields) = "v" -> True "xml" -> True "yaml" -> True - "style" -> True _ -> False pWithContents :: PandocMonad m => P m a -> Seq Content -> P m a @@ -515,12 +507,6 @@ handleInline tok = LExact x LPt -> toRational x / 12 _ -> 1 / 3 -- guess! pure $ B.text $ getSpaceChars em - Elt "style" _ fields -> do - Function f <- getField "func" fields - case applyPureFunction (Function f) [VStyles] of - Success (VContent cs) -> pWithContents pInlines cs - Success x -> pure $ B.text $ repr x - Failure e -> fail e Elt "place" _pos fields -> do ignored "parameters of place" getField "body" fields >>= pWithContents pInlines diff --git a/stack.yaml b/stack.yaml index 5c4149b3d..489c279eb 100644 --- a/stack.yaml +++ b/stack.yaml @@ -25,7 +25,7 @@ extra-deps: - typst-symbols-0.1.2 - toml-parser-1.1.1.0 - git: https://github.com/jgm/typst-hs - commit: cd2583f638033cdedda2460642c93315fbc11979 + commit: be9e946616b1564106255a4de7e69a70c5be848b - git: https://github.com/jgm/pandoc-types commit: 2b68c905e75c65e66eaa4635e4c1bd6aabd6302f |
