packages feed

pandoc 3.1.6 → 3.1.6.1

raw patch · 23 files changed

+621/−60 lines, 23 filesdep ~bytestringdep ~deepseqdep ~pandoc-typesPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: bytestring, deepseq, pandoc-types

API changes (from Hackage documentation)

Files

AUTHORS.md view
@@ -91,6 +91,7 @@ - Denis Maier - Derek Chen-Becker - Diego Balseiro+- Diogo Almiro - Dimitri Sabadie - Dimitris Apostolou - Dmitry Pogodin
MANUAL.txt view
@@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane-date: July 20, 2023+date: August 11, 2023 ---  # Synopsis
changelog.md view
@@ -1,8 +1,58 @@ # Revision history for pandoc +## pandoc 3.1.6.1 (2023-08-11)++ * HTML reader: properly calculate RowHeadColumns (#8984). This fixes a+   bug in the calculation of the number of header columns in table row.+   It also changes the algorithm for determining the table body's+   RowHeadColumns based on the numbers of head columns in each row.+   Previously we used the max, and #8634 switched to the min, which+   led to bad results. Now we only set RowHeadColumns to a non-zero value+   if *all* rows have the same number of head columns.++  * OpenDocument writer:++    + Implement syntax highlighting for inline and block code (#6710).+    + Support highlighted text in ODT/OpenDocument writers for Span+      with class `mark` (#8960). The color can be adjusted by+      modifying the Highlighted style.++  * Typst writer: escape `//` so it doesn't get interpreted as a comment+    (#8966).++  * ChunkedHTML writer: Fix regression including MathJax script (#8967).+    The fix for #8620 caused the script to be included when the table of+    contents but not the body text of a page contains math.  But it broke the+    case where the table of contents doesn't contain math but the page does.+    This patch fixes the issue.++  * Text.Pandoc.SelfContained:++    + Retain attributes in SVG tag when referring to another+      SVG's content using `<use>` (#8969).+    + Allow units in width and height for SVG. Units are optional but allowed.+    + Don't coerce calculated SVG dimensions to Int.+    + fix calculation of SVG width and height. We were computing width and+      height from viewBox incorrectly (#8969).+    + Add clause for SVG to default CSS for HTML (#8969).+    + Ensure that width and height attributes don't get specified+      twice is both the img tag and the svg include them (#8965).+    + Omit unnecessary attributes xmlns, xmlns:xlink, and version on+      SVG element (#8965).+    + Use 20 character rather than 40 character hashes for generated IDs+      (#8965).++  * Use pandoc-types 1.23.1. This fixes a regression with toJSONFilter (#8976),+    which in 1.23.0.1 no longer worked on pure values of type `a -> [a]`.++  * Use ghc 9.6 for release builds (#8947).++  * Fix some links in FAQs (Diogo Almiro).++ ## pandoc 3.1.6 (2023-07-20) -  * Fix new variant of the vulnerability in CVE-2023-35936.+  * Fix CVE-2023-38745, a variant of the vulnerability in CVE-2023-35936.     Guilhem Moulin noticed that the fix to CVE-2023-35936 was incomplete.     An attacker could get around it by double-encoding the malicious     extension to create or override arbitrary files.
data/odt/styles.xml view
@@ -250,14 +250,19 @@       fo:font-size="10pt" style:font-name-asian="Courier New"       style:font-size-asian="10pt"       style:font-name-complex="Courier New"-      style:font-size-complex="10pt" />+      style:font-size-complex="10pt"+      fo:language="zxx" />     </style:style>     <style:style style:name="Source_Text" style:family="text">       <style:text-properties style:font-name="Courier New"       fo:font-size="10pt" style:font-name-asian="Courier New"       style:font-size-asian="10pt"       style:font-name-complex="Courier New"-      style:font-size-complex="10pt" />+      style:font-size-complex="10pt"+      fo:language="zxx" />+    </style:style>+    <style:style style:name="Highlighted" style:family="text">+      <style:text-properties fo:background-color="#ffff38" />     </style:style>     <style:style style:name="Definition_20_Term"     style:display-name="Definition Term" style:family="paragraph"
data/templates/default.opendocument view
@@ -3,6 +3,9 @@   <office:font-face-decls>     <style:font-face style:name="Courier New" style:font-family-generic="modern" style:font-pitch="fixed" svg:font-family="'Courier New'" />   </office:font-face-decls>+  <office:styles>+    $highlighting-styles$+  </office:styles>   <office:automatic-styles>     $automatic-styles$   </office:automatic-styles>
data/templates/styles.html view
@@ -62,6 +62,10 @@ img {   max-width: 100%; }+svg {+  height; auto;+  max-width: 100%;+} h1, h2, h3, h4, h5, h6 {   margin-top: 1.4em; }
man/pandoc.1 view
@@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\}-.TH "Pandoc User\[cq]s Guide" "" "July 20, 2023" "pandoc 3.1.6" ""+.TH "Pandoc User\[cq]s Guide" "" "August 11, 2023" "pandoc 3.1.6" "" .hy .SH NAME pandoc - general markup converter
pandoc.cabal view
@@ -1,6 +1,6 @@ cabal-version:   2.4 name:            pandoc-version:         3.1.6+version:         3.1.6.1 build-type:      Simple license:         GPL-2.0-or-later license-file:    COPYING.md@@ -470,7 +470,7 @@                  binary                >= 0.7      && < 0.11,                  blaze-html            >= 0.9      && < 0.10,                  blaze-markup          >= 0.8      && < 0.9,-                 bytestring            >= 0.9      && < 0.12,+                 bytestring            >= 0.9      && < 0.13,                  case-insensitive      >= 1.2      && < 1.3,                  citeproc              >= 0.8.1    && < 0.9,                  commonmark            >= 0.2.3    && < 0.3,@@ -479,7 +479,7 @@                  containers            >= 0.6.0.1  && < 0.7,                  crypton-connection    >= 0.3.1    && < 0.4,                  data-default          >= 0.4      && < 0.8,-                 deepseq               >= 1.3      && < 1.5,+                 deepseq               >= 1.3      && < 1.6,                  directory             >= 1.2.3    && < 1.4,                  doclayout             >= 0.4.0.1  && < 0.5,                  doctemplates          >= 0.11     && < 0.12,@@ -499,7 +499,7 @@                  mtl                   >= 2.2      && < 2.4,                  network               >= 2.6      && < 3.2,                  network-uri           >= 2.6      && < 2.8,-                 pandoc-types          >= 1.23     && < 1.24,+                 pandoc-types          >= 1.23.1   && < 1.24,                  parsec                >= 3.1      && < 3.2,                  pretty                >= 1.1      && < 1.2,                  pretty-show           >= 1.10     && < 1.11,@@ -752,13 +752,13 @@   build-depends:  pandoc,                   Diff              >= 0.2     && < 0.5,                   Glob              >= 0.7     && < 0.11,-                  bytestring        >= 0.9     && < 0.12,+                  bytestring        >= 0.9     && < 0.13,                   containers        >= 0.4.2.1 && < 0.7,                   directory         >= 1.2.3   && < 1.4,                   doctemplates      >= 0.11    && < 0.12,                   filepath          >= 1.1     && < 1.5,                   mtl               >= 2.2     && < 2.4,-                  pandoc-types      >= 1.23    && < 1.24,+                  pandoc-types      >= 1.23.1  && < 1.24,                   process           >= 1.2.3   && < 1.7,                   tasty             >= 0.11    && < 1.5,                   tasty-golden      >= 2.3     && < 2.4,
src/Text/Pandoc/Readers/HTML/Table.hs view
@@ -15,10 +15,12 @@ -} module Text.Pandoc.Readers.HTML.Table (pTable) where +import qualified Data.Vector as V import Control.Applicative ((<|>)) import Data.Maybe (fromMaybe, isJust) import Data.Either (lefts, rights) import Data.List.NonEmpty (nonEmpty)+import Data.List (foldl') import Data.Text (Text) import Text.HTML.TagSoup import Text.Pandoc.Builder (Blocks)@@ -123,19 +125,18 @@ toStyleString :: [(Text, Text)] -> Text toStyleString = T.intercalate "; " . map (\(k, v) -> k <> ": " <> v) --- | Parses a normal table row; returns the row together with the number--- of header cells at the beginning of the row.+-- | Parses a normal table row; returns the row and the number+-- of cells at the beginning that are header cells. pRow :: PandocMonad m      => TagParser m Blocks-     -> TagParser m (RowHeadColumns, B.Row)+     -> TagParser m (Int, B.Row) pRow block = try $ do   skipMany pBlank   TagOpen _ attribs <- pSatisfy (matchTagOpen "tr" []) <* skipMany pBlank   cells <- many (pCell block BodyCell <|> pCell block HeaderCell)   TagClose _ <- pSatisfy (matchTagClose "tr")-  return ( RowHeadColumns $ length (takeWhile ((== HeaderCell) . fst) cells)-         , Row (toAttr attribs) $ map snd cells-         )+  let numheadcells = length $ takeWhile (\(ct,_) -> ct == HeaderCell) cells+  return (numheadcells, Row (toAttr attribs) $ map snd cells)  -- | Parses a header row, i.e., a row which containing nothing but -- @<th>@ elements.@@ -144,7 +145,7 @@            -> TagParser m B.Row pHeaderRow block = try $ do   skipMany pBlank-  let pThs = map snd <$> many (pCell block HeaderCell)+  let pThs = many (snd <$> pCell block HeaderCell)   let mkRow (attribs, cells) = Row (toAttr attribs) cells   mkRow <$> pInTagWithAttribs TagsRequired "tr" pThs @@ -174,7 +175,7 @@ pTableFoot block = try $ do   skipMany pBlank   TagOpen _ attribs <- pSatisfy (matchTagOpen "tfoot" []) <* skipMany pBlank-  rows <- many (fmap snd $ pRow block <* skipMany pBlank)+  rows <- many $ snd <$> (pRow block <* skipMany pBlank)   optional $ pSatisfy (matchTagClose "tfoot")   return $ TableFoot (toAttr attribs) rows @@ -187,16 +188,34 @@   mbattribs <- option Nothing $ Just . getAttribs <$>                  pSatisfy (matchTagOpen "tbody" []) <* skipMany pBlank   bodyheads <- many (pHeaderRow block)-  (rowheads, rows) <- unzip <$> many (pRow block <* skipMany pBlank)+  rows <- many (pRow block <* skipMany pBlank)   optional $ pSatisfy (matchTagClose "tbody")   guard $ isJust mbattribs || not (null bodyheads && null rows)   let attribs = fromMaybe [] mbattribs-  return $ TableBody (toAttr attribs) (getMin rowheads) bodyheads rows+  -- we only set row head columns if all rows agree;+  -- if some rows have headings but others not, we use 0; see #8984, #8634:+  let numrows = length rows+  let adjustRowHeadColsForCell currentrow headcolsv+                    (Cell _ _ (RowSpan rowspan) (ColSpan colspan) _) =+        V.imap (\i x -> if i >= currentrow &&+                           i < currentrow + rowspan+                           then x + colspan+                           else x) headcolsv+  let adjustRowHeadCols+        headcolsv+        (currentrow, (numheads, Row _ cells)) =+          foldl' (adjustRowHeadColsForCell currentrow) headcolsv+            (take numheads cells)+  let headcols = foldl' adjustRowHeadCols+                         (V.replicate numrows (0 :: Int))+                         (zip [(0 :: Int)..] rows)+  let rowHeadCols = case V.uncons headcols of+                       Just (x, v) | all (== x) v -> RowHeadColumns x+                       _ -> RowHeadColumns 0+  return $ TableBody (toAttr attribs) rowHeadCols bodyheads (map snd rows)   where     getAttribs (TagOpen _ attribs) = attribs     getAttribs _ = []-    getMin [] = 0-    getMin (x:xs) = foldr min x xs  -- | Parses a simple HTML table pTable :: PandocMonad m
src/Text/Pandoc/SelfContained.hs view
@@ -69,7 +69,8 @@ data ConvertState =   ConvertState   { isHtml5 :: Bool-  , svgMap  :: M.Map T.Text T.Text -- map from hash to id+  , svgMap  :: M.Map T.Text (T.Text, [Attribute T.Text])+    -- map from hash to (id, svg attributes)   } deriving (Show)  convertTags :: PandocMonad m =>@@ -157,10 +158,8 @@                            _ -> rest              svgmap <- gets svgMap              case M.lookup hash svgmap of-               Just svgid -> do-                 let attrs' = if ("id", svgid) `elem` attrs-                                 then [(k,v) | (k,v) <- attrs, k /= "id"]-                                 else attrs+               Just (svgid, svgattrs) -> do+                 let attrs' = combineSvgAttrs svgattrs attrs                  return $ TagOpen "svg" attrs' :                           TagOpen "use" [("href", "#" <> svgid)] :                           TagClose "use" :@@ -170,14 +169,12 @@                   case dropWhile (not . isTagOpenName "svg") tags of                     TagOpen "svg" svgattrs : tags' -> do                       let attrs' = combineSvgAttrs svgattrs attrs-                      let (svgId, attrs'') = -- keep original image id if present-                            case lookup "id" as of-                              Just id' -> (id', attrs')-                              Nothing  ->-                                let newid = "svg_" <> hash-                                 in (newid, ("id", newid) :-                                             filter (\(k,_) -> k /= "id") attrs')-                      modify $ \st -> st{ svgMap = M.insert hash svgId (svgMap st) }+                      let svgid = case lookup "id" attrs' of+                                     Just id' -> id'+                                     Nothing -> "svg_" <> hash+                      let attrs'' = [(k,v) | (k,v) <- attrs', k /= "id"]+                      modify $ \st ->+                        st{ svgMap = M.insert hash (svgid, attrs'') (svgMap st) }                       return $ TagOpen "svg" attrs'' : tags' ++ rest'                     _ -> return $ TagOpen tagname attrs : rest   where processAttribute (x,y) =@@ -189,9 +186,9 @@                   Fetched ("image/svg+xml", bs) -> do                     -- we filter CR in the hash to ensure that Windows                     -- and non-Windows tests agree:-                    let hash = T.pack (showDigest-                                        (sha1 (L.fromStrict-                                           (B.filter (/='\r') bs))))+                    let hash = T.pack $ take 20 $ showDigest $+                                        sha1 $ L.fromStrict+                                             $ B.filter (/='\r') bs                     return $ Left (hash, getSvgTags (toText bs))                   Fetched (mt,bs) -> return $ Right (x, makeDataURI (mt,bs))                   CouldNotFetch _ -> return $ Right (x, y)@@ -213,14 +210,21 @@   case (mbViewBox, mbHeight, mbWidth) of     (Nothing, Just h, Just w) -> -- calculate viewBox       combinedAttrs ++ [("viewBox", T.unwords ["0", "0", tshow w, tshow h])]-    (Just (llx,lly,urx,ury), Nothing, Nothing) -> -- calculate width, height-      combinedAttrs ++-        [ ("width", tshow (floor urx - floor llx :: Int))-        , ("height", tshow (floor ury - floor lly :: Int)) ]+    (Just (_minx,_miny,w,h), Nothing, Nothing) ->+        combinedAttrs +++        [ ("width", dropPointZero (tshow w)) |+            isNothing (lookup "width" combinedAttrs) ] +++        [ ("height", dropPointZero (tshow h)) |+            isNothing (lookup "height" combinedAttrs) ]     _ -> combinedAttrs  where+  dropPointZero t = case T.stripSuffix ".0" t of+                       Nothing -> t+                       Just t' -> t'   combinedAttrs = imgAttrs ++-    [(k,v) | (k,v) <- svgAttrs, isNothing (lookup k imgAttrs)]+    [(k, v) | (k, v) <- svgAttrs+            , isNothing (lookup k imgAttrs)+            , k `notElem` ["xmlns", "xmlns:xlink", "version"]]   parseViewBox t =     case map (safeRead . addZero) $ T.words t of       [Just llx, Just lly, Just urx, Just ury] -> Just (llx, lly, urx, ury)
src/Text/Pandoc/Writers/ChunkedHTML.hs view
@@ -94,7 +94,7 @@     Left e   -> throwError $ PandocTemplateError (T.pack e)     Right t  -> return t   tocMathVariable <- writeHtml5String opts{ writerTemplate = Just mathVar }-                    (Pandoc nullMeta [tree])+                    (Pandoc meta (tree:blocks))   let opts' = opts{ writerVariables =                         defField "table-of-contents" renderedTOC                       . defField "math" tocMathVariable
src/Text/Pandoc/Writers/OpenDocument.hs view
@@ -15,7 +15,7 @@ -} module Text.Pandoc.Writers.OpenDocument ( writeOpenDocument ) where import Control.Arrow ((***), (>>>))-import Control.Monad (unless, liftM)+import Control.Monad (unless, liftM, MonadPlus(mplus)) import Control.Monad.State.Strict ( StateT(..), modify, gets, lift ) import Data.Char (chr) import Data.Foldable (find)@@ -45,6 +45,7 @@ import Text.Printf (printf) import Text.Pandoc.Highlighting (highlight) import Skylighting+import qualified Data.Map as M  -- | Auxiliary function to convert Plain block to Para. plainToPara :: Block -> Block@@ -267,9 +268,11 @@                           [("style:name", "L" <> tshow n)] (vcat l)   let listStyles  = map listStyle (stListStyles s)   let automaticStyles = vcat $ reverse $ styles ++ listStyles+  let highlightingStyles = maybe mempty styleToOpenDocument (writerHighlightStyle opts)   let context = defField "body" body               . defField "toc" (writerTableOfContents opts)               . defField "toc-depth" (tshow $ writerTOCDepth opts)+              . defField "highlighting-styles" highlightingStyles               . defField "automatic-styles" automaticStyles               $ metadata   return $ render colwidth $@@ -285,10 +288,10 @@     where go i = (<>) i <$>  withParagraphStyle o s bs withParagraphStyle _ _ [] = return empty -inPreformattedTags :: PandocMonad m => Text -> OD m (Doc Text)+inPreformattedTags :: PandocMonad m => [Doc Text] -> OD m (Doc Text) inPreformattedTags s = do   n <- paraStyle [("style:parent-style-name","Preformatted_20_Text")]-  return . inParagraphTagsWithStyle ("P" <> tshow n) . handleSpaces $ s+  return $ inParagraphTagsWithStyle ("P" <> tshow n) $ hcat s  orderedListToOpenDocument :: PandocMonad m                           => WriterOptions -> Int -> [[Block]] -> OD m (Doc Text)@@ -385,7 +388,17 @@     DefinitionList b -> setFirstPara >> defList b     BulletList     b -> setFirstPara >> bulletListToOpenDocument o b     OrderedList  a b -> setFirstPara >> orderedList a b-    CodeBlock    _ s -> setFirstPara >> preformatted s+    CodeBlock attrs s -> do+      setFirstPara+      if isNothing (writerHighlightStyle o)+         then unhighlighted s+         else case highlight (writerSyntaxMap o) formatOpenDocument attrs s of+                Right h  -> return $ flush . vcat $ map (inTags True "text:p"+                                          [("text:style-name",+                                            "Preformatted_20_Text")] . hcat) h+                Left msg -> do+                  unless (T.null msg) $ report $ CouldNotHighlight msg+                  unhighlighted s     Table a bc s th tb tf -> setFirstPara >> table (Ann.toTable a bc s th tb tf)     HorizontalRule   -> setFirstPara >> return (selfClosingTag "text:p"                          [ ("text:style-name", "Horizontal_20_Line") ])@@ -398,7 +411,8 @@                            r <- vcat  <$> mapM (deflistItemToOpenDocument o) b                            setInDefinitionList False                            return r-      preformatted  s = flush . vcat <$> mapM (inPreformattedTags . escapeStringForXML) (T.lines s)+      unhighlighted s = flush . vcat <$>+            (mapM (inPreformattedTags . (:[])) (map preformatted (T.lines s)))       mkDiv    attr s = do         let (ident,_,kvs) = attr             i = withLangFromAttr attr $@@ -594,6 +608,9 @@      | writerWrapText o == WrapPreserve                   -> return $ preformatted "\n"      | otherwise  -> return space+    Span ("", ["mark"], []) xs ->+      inTags False "text:span" [("text:style-name","Highlighted")] <$>+        inlinesToOpenDocument o xs     Span attr xs  -> mkSpan attr xs     LineBreak     -> return $ selfClosingTag "text:line-break" []     Str         s -> return $ handleSpaces $ escapeStringForXML s@@ -609,7 +626,7 @@       then unhighlighted s       else case highlight (writerSyntaxMap o)                   formatOpenDocument attrs s of-                Right h  -> return $ mconcat $ mconcat h+                Right h  -> inlinedCode $ mconcat $ mconcat h                 Left msg -> do                   unless (T.null msg) $ report $ CouldNotHighlight msg                   unhighlighted s@@ -627,14 +644,9 @@     Image attr _ (s,t) -> mkImg attr s t     Note        l  -> mkNote l     where-      formatOpenDocument :: FormatOptions -> [SourceLine] -> [[Doc Text]]-      formatOpenDocument _fmtOpts = map (map toHlTok)-      toHlTok :: Token -> Doc Text-      toHlTok (toktype,tok) =-        inTags False "text:span" [("text:style-name", T.pack $ show toktype)] $ preformatted tok       unhighlighted s = inlinedCode $ preformatted s-      preformatted s = handleSpaces $ escapeStringForXML s-      inlinedCode s = return $ inTags False "text:span" [("text:style-name", "Source_Text")] s+      inlinedCode s = return $ inTags False "text:span"+                                 [("text:style-name", "Source_Text")] s       mkImg (_, _, kvs) s _ = do                id' <- gets stImageId                modify (\st -> st{ stImageId = id' + 1 })@@ -671,6 +683,15 @@         addNote nn         return nn +formatOpenDocument :: FormatOptions -> [SourceLine] -> [[Doc Text]]+formatOpenDocument _fmtOpts = map (map toHlTok)+toHlTok :: Token -> Doc Text+toHlTok (toktype,tok) =+  inTags False "text:span" [("text:style-name", T.pack $ show toktype)] $ preformatted tok++preformatted :: Text -> Doc Text+preformatted s = handleSpaces $ escapeStringForXML s+ mkLink :: WriterOptions -> [(Text,ReferenceType)] -> Text -> Text -> Doc Text -> Doc Text mkLink o identTypes s t d =   let maybeIdentAndType = case T.uncons s of@@ -901,3 +922,24 @@               Left _ -> do                 report $ InvalidLang l                 action++styleToOpenDocument :: Style -> Doc Text+styleToOpenDocument style = vcat (map toStyle alltoktypes)+  where alltoktypes = enumFromTo KeywordTok NormalTok+        toStyle toktype = inTags True "style:style" [("style:name", tshow toktype),+                                                     ("style:family", "text")] $+                             selfClosingTag "style:text-properties"+                               (tokColor toktype ++ tokBgColor toktype +++                                 [("fo:font-style", "italic") |+                                    tokFeature tokenItalic toktype ] +++                                 [("fo:font-weight", "bold") |+                                    tokFeature tokenBold toktype ] +++                                 [("style:text-underline-style", "solid") |+                                    tokFeature tokenUnderline toktype ])+        tokStyles = tokenStyles style+        tokFeature f toktype = maybe False f $ M.lookup toktype tokStyles+        tokColor toktype = maybe [] (\c -> [("fo:color", T.pack (fromColor c))])+                         $ (tokenColor =<< M.lookup toktype tokStyles)+                           `mplus` defaultColor style+        tokBgColor toktype = maybe [] (\c -> [("fo:background-color", T.pack (fromColor c))])+                         $ (tokenBackground =<< M.lookup toktype tokStyles)
src/Text/Pandoc/Writers/Typst.hs view
@@ -290,6 +290,7 @@  escapeTypst :: EscapeContext -> Text -> Text escapeTypst context t =+  T.replace "//" "\\/\\/" $   if T.any needsEscape t      then T.concatMap escapeChar t      else t
test/command/6792.md view
@@ -21,6 +21,101 @@   <office:font-face-decls>     <style:font-face style:name="Courier New" style:font-family-generic="modern" style:font-pitch="fixed" svg:font-family="'Courier New'" />   </office:font-face-decls>+  <office:styles>+    <style:style style:name="KeywordTok" style:family="text">+      <style:text-properties fo:color="#007020" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="DataTypeTok" style:family="text">+      <style:text-properties fo:color="#902000" />+    </style:style>+    <style:style style:name="DecValTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="BaseNTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="FloatTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="ConstantTok" style:family="text">+      <style:text-properties fo:color="#880000" />+    </style:style>+    <style:style style:name="CharTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="SpecialCharTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="StringTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="VerbatimStringTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="SpecialStringTok" style:family="text">+      <style:text-properties fo:color="#bb6688" />+    </style:style>+    <style:style style:name="ImportTok" style:family="text">+      <style:text-properties fo:color="#008000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="CommentTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" />+    </style:style>+    <style:style style:name="DocumentationTok" style:family="text">+      <style:text-properties fo:color="#ba2121" fo:font-style="italic" />+    </style:style>+    <style:style style:name="AnnotationTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="CommentVarTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="OtherTok" style:family="text">+      <style:text-properties fo:color="#007020" />+    </style:style>+    <style:style style:name="FunctionTok" style:family="text">+      <style:text-properties fo:color="#06287e" />+    </style:style>+    <style:style style:name="VariableTok" style:family="text">+      <style:text-properties fo:color="#19177c" />+    </style:style>+    <style:style style:name="ControlFlowTok" style:family="text">+      <style:text-properties fo:color="#007020" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="OperatorTok" style:family="text">+      <style:text-properties fo:color="#666666" />+    </style:style>+    <style:style style:name="BuiltInTok" style:family="text">+      <style:text-properties fo:color="#008000" />+    </style:style>+    <style:style style:name="ExtensionTok" style:family="text">+      <style:text-properties />+    </style:style>+    <style:style style:name="PreprocessorTok" style:family="text">+      <style:text-properties fo:color="#bc7a00" />+    </style:style>+    <style:style style:name="AttributeTok" style:family="text">+      <style:text-properties fo:color="#7d9029" />+    </style:style>+    <style:style style:name="RegionMarkerTok" style:family="text">+      <style:text-properties />+    </style:style>+    <style:style style:name="InformationTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="WarningTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="AlertTok" style:family="text">+      <style:text-properties fo:color="#ff0000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="ErrorTok" style:family="text">+      <style:text-properties fo:color="#ff0000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="NormalTok" style:family="text">+      <style:text-properties />+    </style:style>+  </office:styles>   <office:automatic-styles>     <style:style style:name="fr2" style:family="graphic" style:parent-style-name="Formula"><style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" style:wrap="none" /></style:style>     <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Formula"><style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" /></style:style>
test/command/8256.md view
@@ -15,6 +15,101 @@   <office:font-face-decls>     <style:font-face style:name="Courier New" style:font-family-generic="modern" style:font-pitch="fixed" svg:font-family="'Courier New'" />   </office:font-face-decls>+  <office:styles>+    <style:style style:name="KeywordTok" style:family="text">+      <style:text-properties fo:color="#007020" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="DataTypeTok" style:family="text">+      <style:text-properties fo:color="#902000" />+    </style:style>+    <style:style style:name="DecValTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="BaseNTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="FloatTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="ConstantTok" style:family="text">+      <style:text-properties fo:color="#880000" />+    </style:style>+    <style:style style:name="CharTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="SpecialCharTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="StringTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="VerbatimStringTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="SpecialStringTok" style:family="text">+      <style:text-properties fo:color="#bb6688" />+    </style:style>+    <style:style style:name="ImportTok" style:family="text">+      <style:text-properties fo:color="#008000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="CommentTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" />+    </style:style>+    <style:style style:name="DocumentationTok" style:family="text">+      <style:text-properties fo:color="#ba2121" fo:font-style="italic" />+    </style:style>+    <style:style style:name="AnnotationTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="CommentVarTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="OtherTok" style:family="text">+      <style:text-properties fo:color="#007020" />+    </style:style>+    <style:style style:name="FunctionTok" style:family="text">+      <style:text-properties fo:color="#06287e" />+    </style:style>+    <style:style style:name="VariableTok" style:family="text">+      <style:text-properties fo:color="#19177c" />+    </style:style>+    <style:style style:name="ControlFlowTok" style:family="text">+      <style:text-properties fo:color="#007020" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="OperatorTok" style:family="text">+      <style:text-properties fo:color="#666666" />+    </style:style>+    <style:style style:name="BuiltInTok" style:family="text">+      <style:text-properties fo:color="#008000" />+    </style:style>+    <style:style style:name="ExtensionTok" style:family="text">+      <style:text-properties />+    </style:style>+    <style:style style:name="PreprocessorTok" style:family="text">+      <style:text-properties fo:color="#bc7a00" />+    </style:style>+    <style:style style:name="AttributeTok" style:family="text">+      <style:text-properties fo:color="#7d9029" />+    </style:style>+    <style:style style:name="RegionMarkerTok" style:family="text">+      <style:text-properties />+    </style:style>+    <style:style style:name="InformationTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="WarningTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="AlertTok" style:family="text">+      <style:text-properties fo:color="#ff0000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="ErrorTok" style:family="text">+      <style:text-properties fo:color="#ff0000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="NormalTok" style:family="text">+      <style:text-properties />+    </style:style>+  </office:styles>   <office:automatic-styles>     <style:style style:name="T1" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>     <style:style style:name="fr2" style:family="graphic" style:parent-style-name="Formula"><style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" style:wrap="none" /></style:style>
test/command/8948.md view
@@ -3,7 +3,7 @@ ![minimal](command/minimal.svg) ![minimal](command/minimal.svg) ^D-<p><svg alt="minimal"><use href="#svg_7868854ffb8f30209cd098bb6207b390b001249e" /></svg> <svg id="svg_7868854ffb8f30209cd098bb6207b390b001249e" alt="minimal" viewBox="-.333 -.333 480 150" style="background-color:#ffffff00" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" width="481" height="151">+<p><svg alt="minimal" viewBox="-.333 -.333 480 150" style="background-color:#ffffff00" xml:space="preserve" width="480" height="150"><use href="#svg_7868854ffb8f30209cd0" /></svg> <svg alt="minimal" viewBox="-.333 -.333 480 150" style="background-color:#ffffff00" xml:space="preserve" width="480" height="150">     <path d="M 0 35.5 L 6.5 22.5 L 16 37 L 23 24 L 34.8 43.7 L 42.5 30 L 50.3 47 L 59.7 27.7 L 69 47 L 85 17.7 L 98.3 39 L 113 9.7 L 127.7 42.3 L 136.3 23.7 L 147 44.3 L 158.3 20.3 L 170.3 40.3 L 177.7 25.7 L 189.7 43 L 199.7 21 L 207.7 35 L 219 11 L 233 37 L 240.3 23.7 L 251 43 L 263 18.3 L 272.7 33.3 L 283 10 L 295 32.3 L 301.3 23 L 311.7 37 L 323.7 7.7 L 339.3 39 L 346.3 25.7 L 356.3 42.3 L 369.7 15 L 376.3 25.7 L 384 9 L 393 28.3 L 400.3 19 L 411.7 38.3 L 421 21 L 434.3 43 L 445 25 L 453 36.3 L 464.3 18.3 L 476.2 40.3 L 480 33.5 L 480 215 L 0 215 L 0 35.5 Z" fill="#175720"></path> </svg></p> ```@@ -13,7 +13,7 @@ ![minimal](command/minimal.svg) ![minimal](command/minimal.svg){#foo} ^D-<p><svg alt="minimal"><use href="#foo" /></svg> <svg id="foo" alt="minimal" viewBox="-.333 -.333 480 150" style="background-color:#ffffff00" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" width="481" height="151">+<p><svg alt="minimal" viewBox="-.333 -.333 480 150" style="background-color:#ffffff00" xml:space="preserve" width="480" height="150"><use href="#foo" /></svg> <svg alt="minimal" viewBox="-.333 -.333 480 150" style="background-color:#ffffff00" xml:space="preserve" width="480" height="150">     <path d="M 0 35.5 L 6.5 22.5 L 16 37 L 23 24 L 34.8 43.7 L 42.5 30 L 50.3 47 L 59.7 27.7 L 69 47 L 85 17.7 L 98.3 39 L 113 9.7 L 127.7 42.3 L 136.3 23.7 L 147 44.3 L 158.3 20.3 L 170.3 40.3 L 177.7 25.7 L 189.7 43 L 199.7 21 L 207.7 35 L 219 11 L 233 37 L 240.3 23.7 L 251 43 L 263 18.3 L 272.7 33.3 L 283 10 L 295 32.3 L 301.3 23 L 311.7 37 L 323.7 7.7 L 339.3 39 L 346.3 25.7 L 356.3 42.3 L 369.7 15 L 376.3 25.7 L 384 9 L 393 28.3 L 400.3 19 L 411.7 38.3 L 421 21 L 434.3 43 L 445 25 L 453 36.3 L 464.3 18.3 L 476.2 40.3 L 480 33.5 L 480 215 L 0 215 L 0 35.5 Z" fill="#175720"></path> </svg></p> ```
+ test/command/8966.md view
@@ -0,0 +1,9 @@+```+% pandoc -t typst+**Samsonov T.E.** Shape-Adaptive Geometric Simplification of Heterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova // International Journal of Geographical Information Science. — 2017. — Vol. 31. — № 8. — pp. 1485-1520.+^D+#strong[Samsonov T.E.] Shape-Adaptive Geometric Simplification of+Heterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova \/\/+International Journal of Geographical Information Science. — 2017. —+Vol. 31. — № 8. — pp. 1485-1520.+```
+ test/command/8984.md view
@@ -0,0 +1,122 @@+```+% pandoc -f html -t native+<table>+  <tr>+    <th colspan="2">a</th>+    <td>b</td>+  </tr>+  <tr>+    <th>c</th>+    <th>d</th>+    <td>e</td>+  </tr>+</table>+^D+[ Table+    ( "" , [] , [] )+    (Caption Nothing [])+    [ ( AlignDefault , ColWidthDefault )+    , ( AlignDefault , ColWidthDefault )+    , ( AlignDefault , ColWidthDefault )+    ]+    (TableHead ( "" , [] , [] ) [])+    [ TableBody+        ( "" , [] , [] )+        (RowHeadColumns 2)+        []+        [ Row+            ( "" , [] , [] )+            [ Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 2)+                [ Plain [ Str "a" ] ]+            , Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 1)+                [ Plain [ Str "b" ] ]+            ]+        , Row+            ( "" , [] , [] )+            [ Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 1)+                [ Plain [ Str "c" ] ]+            , Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 1)+                [ Plain [ Str "d" ] ]+            , Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 1)+                [ Plain [ Str "e" ] ]+            ]+        ]+    ]+    (TableFoot ( "" , [] , [] ) [])+]++```++```+% pandoc -f html -t native+<table>+<tr>+<th rowspan="2">Heading</th>+<td>content</td>+</tr>+<tr>+<td>content2</td>+</tr>+</table>+^D+[ Table+    ( "" , [] , [] )+    (Caption Nothing [])+    [ ( AlignDefault , ColWidthDefault )+    , ( AlignDefault , ColWidthDefault )+    ]+    (TableHead ( "" , [] , [] ) [])+    [ TableBody+        ( "" , [] , [] )+        (RowHeadColumns 1)+        []+        [ Row+            ( "" , [] , [] )+            [ Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 2)+                (ColSpan 1)+                [ Plain [ Str "Heading" ] ]+            , Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 1)+                [ Plain [ Str "content" ] ]+            ]+        , Row+            ( "" , [] , [] )+            [ Cell+                ( "" , [] , [] )+                AlignDefault+                (RowSpan 1)+                (ColSpan 1)+                [ Plain [ Str "content2" ] ]+            ]+        ]+    ]+    (TableFoot ( "" , [] , [] ) [])+]++```
test/lhs-test.html view
@@ -60,6 +60,10 @@     img {       max-width: 100%;     }+    svg {+      height; auto;+      max-width: 100%;+    }     h1, h2, h3, h4, h5, h6 {       margin-top: 1.4em;     }
test/lhs-test.html+lhs view
@@ -60,6 +60,10 @@     img {       max-width: 100%;     }+    svg {+      height; auto;+      max-width: 100%;+    }     h1, h2, h3, h4, h5, h6 {       margin-top: 1.4em;     }
test/writer.html4 view
@@ -63,6 +63,10 @@     img {       max-width: 100%;     }+    svg {+      height; auto;+      max-width: 100%;+    }     h1, h2, h3, h4, h5, h6 {       margin-top: 1.4em;     }
test/writer.html5 view
@@ -63,6 +63,10 @@     img {       max-width: 100%;     }+    svg {+      height; auto;+      max-width: 100%;+    }     h1, h2, h3, h4, h5, h6 {       margin-top: 1.4em;     }
test/writer.opendocument view
@@ -3,6 +3,101 @@   <office:font-face-decls>     <style:font-face style:name="Courier New" style:font-family-generic="modern" style:font-pitch="fixed" svg:font-family="'Courier New'" />   </office:font-face-decls>+  <office:styles>+    <style:style style:name="KeywordTok" style:family="text">+      <style:text-properties fo:color="#007020" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="DataTypeTok" style:family="text">+      <style:text-properties fo:color="#902000" />+    </style:style>+    <style:style style:name="DecValTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="BaseNTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="FloatTok" style:family="text">+      <style:text-properties fo:color="#40a070" />+    </style:style>+    <style:style style:name="ConstantTok" style:family="text">+      <style:text-properties fo:color="#880000" />+    </style:style>+    <style:style style:name="CharTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="SpecialCharTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="StringTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="VerbatimStringTok" style:family="text">+      <style:text-properties fo:color="#4070a0" />+    </style:style>+    <style:style style:name="SpecialStringTok" style:family="text">+      <style:text-properties fo:color="#bb6688" />+    </style:style>+    <style:style style:name="ImportTok" style:family="text">+      <style:text-properties fo:color="#008000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="CommentTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" />+    </style:style>+    <style:style style:name="DocumentationTok" style:family="text">+      <style:text-properties fo:color="#ba2121" fo:font-style="italic" />+    </style:style>+    <style:style style:name="AnnotationTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="CommentVarTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="OtherTok" style:family="text">+      <style:text-properties fo:color="#007020" />+    </style:style>+    <style:style style:name="FunctionTok" style:family="text">+      <style:text-properties fo:color="#06287e" />+    </style:style>+    <style:style style:name="VariableTok" style:family="text">+      <style:text-properties fo:color="#19177c" />+    </style:style>+    <style:style style:name="ControlFlowTok" style:family="text">+      <style:text-properties fo:color="#007020" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="OperatorTok" style:family="text">+      <style:text-properties fo:color="#666666" />+    </style:style>+    <style:style style:name="BuiltInTok" style:family="text">+      <style:text-properties fo:color="#008000" />+    </style:style>+    <style:style style:name="ExtensionTok" style:family="text">+      <style:text-properties />+    </style:style>+    <style:style style:name="PreprocessorTok" style:family="text">+      <style:text-properties fo:color="#bc7a00" />+    </style:style>+    <style:style style:name="AttributeTok" style:family="text">+      <style:text-properties fo:color="#7d9029" />+    </style:style>+    <style:style style:name="RegionMarkerTok" style:family="text">+      <style:text-properties />+    </style:style>+    <style:style style:name="InformationTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="WarningTok" style:family="text">+      <style:text-properties fo:color="#60a0b0" fo:font-style="italic" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="AlertTok" style:family="text">+      <style:text-properties fo:color="#ff0000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="ErrorTok" style:family="text">+      <style:text-properties fo:color="#ff0000" fo:font-weight="bold" />+    </style:style>+    <style:style style:name="NormalTok" style:family="text">+      <style:text-properties />+    </style:style>+  </office:styles>   <office:automatic-styles>     <text:list-style style:name="L1">       <text:list-level-style-number text:level="1" text:style-name="Numbering_20_Symbols" style:num-format="1" text:start-value="1" style:num-suffix=".">