packages feed

pandoc 2.19.1 → 2.19.2

raw patch · 34 files changed

+220/−52 lines, 34 filesdep ~hslua-module-path

Dependency ranges changed: hslua-module-path

Files

AUTHORS.md view
@@ -356,6 +356,7 @@ - jeongminkim-islab - kaizshang91 - lux-lth+- luz paz - lwolfsonkin - mbrackeantidot - mjfs
MANUAL.txt view
@@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane-date: August 18, 2022+date: August 22, 2022 ---  # Synopsis
changelog.md view
@@ -1,5 +1,36 @@ # Revision history for pandoc +## pandoc 2.19.2 (2022-08-22)++  * Fix regression with data uris in 2.19.1 (#8239).+    In 2.19.1 we used the base64URL encoding rather than base64.++  * pandoc-server: handle `citeproc` parameter as documented (#8235).++  * Org reader: treat *emacs-jupyter* src blocks as code cells (#8236,+    Albert Krewinkel). This improves support for notebook-like org files+    that are intended to be used with emacs-jupyter package.++  * HTML writer and templates: revert to using `width` property for column+    widths (Albert Krewinkel). The default `flex` and `overflow-x` properties+    of a column are set to `auto`. In combination, these changes allow to+    get good results when using columns with or without explicit widths.++  * Org writer (Albert Krewinkel):++    + Add support for jupyter nodebook cells (#6367).+    + Prefix code language of ipynb code blocks with `jupyter-`.+      This is the convention used by the *emacs-jupyter* package.+    + Keep code block attributes as header args. This allows to keep more+      information in the resulting `src` blocks, making it easier to+      roundtrip from or through Org. Org babel ignores unknown header+      arguments.+    + Add code block identifier as `#+name` to src blocks.++  * Fix some typos in the codebase (luz paz).++  * Require hslua-module-path 1.0.3 (#8228, Albert Krewinkel).+ ## pandoc 2.19.1 (2022-08-18)    * Add server capabilities.
data/templates/default.rst view
@@ -12,7 +12,7 @@ :Date: $^$$date$ $endif$ $if(address)$-:Addresss: $^$$address$+:Address: $^$$address$ $endif$ $if(contact)$ :Contact: $^$$contact$
data/templates/styles.html view
@@ -164,7 +164,7 @@ code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} div.columns{display: flex; gap: min(4vw, 1.5em);}-div.column{flex: 1;}+div.column{flex: auto; overflow-x: auto;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} ul.task-list li input[type="checkbox"] {
man/pandoc.1 view
@@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\}-.TH "Pandoc User\[cq]s Guide" "" "August 18, 2022" "pandoc 2.19.1" ""+.TH "Pandoc User\[cq]s Guide" "" "August 22, 2022" "pandoc 2.19.2" "" .hy .SH NAME pandoc - general markup converter
pandoc.cabal view
@@ -1,6 +1,6 @@ cabal-version:   2.4 name:            pandoc-version:         2.19.1+version:         2.19.2 build-type:      Simple license:         GPL-2.0-or-later license-file:    COPYING.md@@ -495,7 +495,7 @@                  gridtables            >= 0.0.3    && < 0.1,                  haddock-library       >= 1.10     && < 1.12,                  hslua-module-doclayout>= 1.0.4    && < 1.1,-                 hslua-module-path     >= 1.0      && < 1.1,+                 hslua-module-path     >= 1.0.3    && < 1.1,                  hslua-module-system   >= 1.0      && < 1.1,                  hslua-module-text     >= 1.0      && < 1.1,                  hslua-module-version  >= 1.0      && < 1.1,
src/Text/Pandoc/Class/IO.hs view
@@ -36,7 +36,7 @@  import Control.Monad.Except (throwError) import Control.Monad.IO.Class (MonadIO, liftIO)-import Data.ByteString.Base64.URL (decodeBase64Lenient)+import Data.ByteString.Base64 (decodeBase64Lenient) import Data.ByteString.Lazy (toChunks) import Data.Text (Text, pack, unpack) import Data.Time (TimeZone, UTCTime)
src/Text/Pandoc/Readers/FB2.hs view
@@ -25,7 +25,7 @@ module Text.Pandoc.Readers.FB2 ( readFB2 ) where import Control.Monad.Except (throwError) import Control.Monad.State.Strict-import Data.ByteString.Lazy.Base64.URL+import Data.ByteString.Lazy.Base64 import Data.Functor import Data.List (intersperse) import qualified Data.Map as M
src/Text/Pandoc/Readers/HTML.hs view
@@ -27,7 +27,7 @@ import Control.Monad (guard, msum, mzero, unless, void) import Control.Monad.Except (throwError, catchError) import Control.Monad.Reader (ask, asks, lift, local, runReaderT)-import Data.Text.Encoding.Base64.URL (encodeBase64)+import Data.Text.Encoding.Base64 (encodeBase64) import Data.Char (isAlphaNum, isLetter) import Data.Default (Default (..), def) import Data.Foldable (for_)
src/Text/Pandoc/Readers/Org/Blocks.hs view
@@ -311,7 +311,11 @@   content        <- rawBlockContent blockType   resultsContent <- option mempty babelResultsBlock   let identifier = fromMaybe mempty $ blockAttrName blockAttrs-  let codeBlk    = B.codeBlockWith (identifier, classes, kv) content+  let classes'   = case classes of+                     c:cs | Just c' <- T.stripPrefix "jupyter-" c ->+                            c' : "code" : cs+                     _ -> classes+  let codeBlk    = B.codeBlockWith (identifier, classes', kv) content   let wrap       = maybe pure addCaption (blockAttrCaption blockAttrs)   return $     (if exportsCode kv    then wrap codeBlk   else mempty) <>
src/Text/Pandoc/SelfContained.hs view
@@ -19,7 +19,7 @@ import Control.Applicative ((<|>)) import Control.Monad.Trans (lift) import Data.ByteString (ByteString)-import Data.ByteString.Base64.URL (encodeBase64)+import Data.ByteString.Base64 (encodeBase64) import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy as L import qualified Data.Text as T
src/Text/Pandoc/Server.hs view
@@ -38,7 +38,6 @@ import Text.Pandoc.Shared (safeStrRead, headerShift, filterIpynbOutput,                            eastAsianLineBreakFilter, stripEmptyParagraphs) import Text.Pandoc.App.Opt ( IpynbOutput (..), Opt(..), defaultOpts )-import Text.Pandoc.Filter (Filter(..)) import Text.Pandoc.Builder (setMeta) import Text.Pandoc.SelfContained (makeSelfContained) import System.Exit@@ -122,6 +121,7 @@   { options               :: Opt   , text                  :: Text   , files                 :: Maybe (M.Map FilePath Blob)+  , citeproc              :: Maybe Bool   } deriving (Show)  instance Default Params where@@ -129,6 +129,7 @@     { options = defaultOpts     , text = mempty     , files = Nothing+    , citeproc = Nothing     }  -- Automatically derive code to convert to/from JSON.@@ -138,6 +139,7 @@      <$> parseJSON (Object o)      <*> o .: "text"      <*> o .:? "files"+     <*> o .:? "citeproc"   -- This is the API.  The "/convert" endpoint takes a request body@@ -327,15 +329,11 @@      let addMetadata m' (Pandoc m bs) = Pandoc (m <> m') bs -    let hasCiteprocFilter [] = False-        hasCiteprocFilter (CiteprocFilter:_) = True-        hasCiteprocFilter (_:xs) = hasCiteprocFilter xs-     reader (text params) >>=       return . transforms . addMetadata meta >>=-      (if hasCiteprocFilter (optFilters opts)-          then processCitations-          else return) >>=+        (case citeproc params of+          Just True -> processCitations+          _ -> return) >>=       writer    htmlFormat :: Maybe Text -> Bool
src/Text/Pandoc/Writers/EPUB.hs view
@@ -449,7 +449,7 @@                       writeHtmlStringForEPUB version o   metadata <- getEPUBMetadata opts meta -  -- retreive title of document+  -- retrieve title of document   let plainTitle :: Text       plainTitle = case docTitle' meta of                         [] -> case epubTitle metadata of
src/Text/Pandoc/Writers/FB2.hs view
@@ -21,7 +21,7 @@ import Control.Monad (zipWithM) import Control.Monad.Except (catchError, throwError) import Control.Monad.State.Strict (StateT, evalStateT, get, gets, lift, liftM, modify)-import Data.ByteString.Base64.URL (encodeBase64)+import Data.ByteString.Base64 (encodeBase64) import Data.Char (isAscii, isControl, isSpace) import Data.Either (lefts, rights) import Data.List (intercalate)
src/Text/Pandoc/Writers/HTML.hs view
@@ -876,7 +876,7 @@   let isCslBibEntry = "csl-entry" `elem` classes   let kvs = [(k,v) | (k,v) <- kvs'                    , k /= "width" || "column" `notElem` classes] ++-            [("style", "flex:" <> w <> ";")  | "column" `elem` classes+            [("style", "width:" <> w <> ";") | "column" `elem` classes                                              , ("width", w) <- kvs'] ++             [("role", "doc-bibliography") | isCslBibBody && html5] ++             [("role", "doc-biblioentry") | isCslBibEntry && html5]
src/Text/Pandoc/Writers/Org.hs view
@@ -105,6 +105,14 @@            => Block         -- ^ Block element            -> Org m (Doc Text) blockToOrg Null = return empty+blockToOrg (Div (_, ["cell", "code"], _) (CodeBlock attr t : bs)) = do+  -- ipynb code cell+  let (ident, classes, kvs) = attr+  blockListToOrg (CodeBlock (ident, classes ++ ["code"], kvs) t : bs)+blockToOrg (Div (_, ["output", "execute_result"], _) [CodeBlock _attr t]) = do+  -- ipynb code result+  return $ "#+RESULTS:" $$+    (prefixed ": " . vcat . map literal $ T.split (== '\n') t) blockToOrg (Div attr@(ident,_,_) bs) = do   opts <- gets stOptions   -- Strip off bibliography if citations enabled@@ -148,7 +156,10 @@                   then empty                   else cr <> propertiesDrawer attr   return $ headerStr <> " " <> contents <> drawerStr <> cr-blockToOrg (CodeBlock (_,classes,kvs) str) = do+blockToOrg (CodeBlock (ident,classes,kvs) str) = do+  let name = if T.null ident+             then empty+             else literal $ "#+name: " <> ident   let startnum = maybe "" (\x -> " " <> trimr x) $ lookup "startFrom" kvs   let numberlines = if "numberLines" `elem` classes                       then if "continuedSourceBlock" `elem` classes@@ -156,10 +167,18 @@                              else " -n" <> startnum                       else ""   let at = map pandocLangToOrg classes `intersect` orgLangIdentifiers-  let (beg, end) = case at of-                      []    -> ("#+begin_example" <> numberlines, "#+end_example")-                      (x:_) -> ("#+begin_src " <> x <> numberlines, "#+end_src")-  return $ literal beg $$ literal str $$ text end $$ blankline+  let lang = case at of+        []  -> Nothing+        l:_ -> if "code" `elem` classes    -- check for ipynb code cell+               then Just ("jupyter-" <> l)+               else Just l+  let args = mconcat $+             [ " :" <> k <> " " <> v+             | (k, v) <- kvs, k `notElem` ["startFrom", "org-language"]]+  let (beg, end) = case lang of+        Nothing -> ("#+begin_example" <> numberlines, "#+end_example")+        Just x  -> ("#+begin_src " <> x <> numberlines <> args, "#+end_src")+  return $ name $$ literal beg $$ literal str $$ literal end $$ blankline blockToOrg (BlockQuote blocks) = do   contents <- blockListToOrg blocks   return $ blankline $$ "#+begin_quote" $$
stack.yaml view
@@ -20,7 +20,7 @@ - hslua-core-2.2.1 - hslua-marshalling-2.2.1 - hslua-module-doclayout-1.0.4-- hslua-module-path-1.0.2+- hslua-module-path-1.0.3 - hslua-module-system-1.0.2 - hslua-module-text-1.0.2 - hslua-module-version-1.0.2
test/Tests/Readers/Creole.hs view
@@ -119,7 +119,7 @@                          , plain "blubb" ]         , "nested many unordered lists, one separating space" =:           ("* foo\n** bar\n*** third\n*** third two\n** baz\n*** third again\n"-           <> "**** fourth\n***** fith\n* blubb")+           <> "**** fourth\n***** fifth\n* blubb")           =?> bulletList [ plain "foo"                            <> bulletList [ plain "bar"                                            <> bulletList [ plain "third"@@ -129,7 +129,7 @@                                                          <> bulletList [                                                              plain "fourth"                                                              <> bulletList [-                                                                 plain "fith"+                                                                 plain "fifth"                                                                  ]                                                              ]                                                          ]@@ -166,7 +166,7 @@                          , plain "blubb" ]         , "nested many ordered lists, one separating space" =:           ("# foo\n## bar\n### third\n### third two\n## baz\n### third again\n"-           <> "#### fourth\n##### fith\n# blubb")+           <> "#### fourth\n##### fifth\n# blubb")           =?> orderedList [ plain "foo"                            <> orderedList [ plain "bar"                                            <> orderedList [ plain "third"@@ -176,7 +176,7 @@                                                          <> orderedList [                                                              plain "fourth"                                                              <> orderedList [-                                                                 plain "fith"+                                                                 plain "fifth"                                                                  ]                                                              ]                                                          ]@@ -189,7 +189,7 @@                          , plain "blubb" ]         , "mixed nested ordered and unordered lists, one separating space" =:           ("# foo\n** bar\n### third\n### third two\n** baz\n### third again\n"-           <> "#### fourth\n***** fith\n# blubb")+           <> "#### fourth\n***** fifth\n# blubb")           =?> orderedList [ plain "foo"                            <> bulletList [ plain "bar"                                            <> orderedList [ plain "third"@@ -199,7 +199,7 @@                                                          <> orderedList [                                                              plain "fourth"                                                              <> bulletList [-                                                                 plain "fith"+                                                                 plain "fifth"                                                                  ]                                                              ]                                                          ]
test/Tests/Readers/Org/Inline.hs view
@@ -186,7 +186,7 @@                   , "3" <> subscript "{}"                   , "4" <> superscript ("(a(" <> strong "b(c" <> ")d))")                   ])-  , "Verbatim text can contain equal signes (=)" =:+  , "Verbatim text can contain equal signs (=)" =:       "=is_subst = True=" =?>       para (codeWith ("", ["verbatim"], []) "is_subst = True") 
test/Tests/Writers/Org.hs view
@@ -66,4 +66,24 @@           , "- ☒ b"           ]     ]++  , testGroup "code blocks"+    [ "identifier"+      =: codeBlockWith ("abc", ["python"], []) "return True"+      =?> T.unlines+      [ "#+name: abc"+      , "#+begin_src python"+      , "return True"+      , "#+end_src"+      ]++    , "attributes"+      =: codeBlockWith ("", ["python"], [("cache", "yes"), ("noweb", "yes")])+                       "'Hello'"+      =?> T.unlines+      [ "#+begin_src python :cache yes :noweb yes"+      , "'Hello'"+      , "#+end_src"+      ]+    ]   ]
test/command/1710.md view
@@ -19,17 +19,17 @@ <section id="slide-one" class="slide level1"> <h1>Slide one</h1> <div class="columns">-<div class="column" style="flex:40%;">+<div class="column" style="width:40%;"> <ul> <li>a</li> <li>b</li> </ul>-</div><div class="column" style="flex:40%;">+</div><div class="column" style="width:40%;"> <ul> <li>c</li> <li>d</li> </ul>-</div><div class="column" style="flex:10%;">+</div><div class="column" style="width:10%;"> <p>ok</p> </div> </div>
+ test/command/6367.md view
@@ -0,0 +1,75 @@+```+% pandoc -f ipynb -t org+{+ "cells": [+  {+   "cell_type": "markdown",+   "metadata": {},+   "source": [+    "A Markdown cell"+   ]+  },+  {+   "cell_type": "code",+   "execution_count": 1,+   "metadata": {},+   "outputs": [+    {+     "data": {+      "text/plain": [+       "2"+      ]+     },+     "execution_count": 1,+     "metadata": {},+     "output_type": "execute_result"+    }+   ],+   "source": [+    "# A code cell\n",+    "1 + 1"+   ]+  },+  {+   "cell_type": "markdown",+   "metadata": {},+   "source": [+    "Another Markdown cell"+   ]+  }+ ],+ "metadata": {+  "kernelspec": {+   "display_name": "Python 3",+   "language": "python",+   "name": "python3"+  },+  "language_info": {+   "codemirror_mode": {+    "name": "ipython",+    "version": 3+   },+   "file_extension": ".py",+   "mimetype": "text/x-python",+   "name": "python",+   "nbconvert_exporter": "python",+   "pygments_lexer": "ipython3",+   "version": "3.8.2"+  }+ },+ "nbformat": 4,+ "nbformat_minor": 4+}+^D+A Markdown cell++#+begin_src jupyter-python+# A code cell+1 + 1+#+end_src++#+RESULTS:+: 2++Another Markdown cell+```
+ test/command/8236.md view
@@ -0,0 +1,15 @@+```+% pandoc -f org -t native+  #+begin_src jupyter-python :session py :display plain+  import pandas as pd+  df = pd.read_csv('weight.csv', parse_dates=['Date'], index_col=0)+  #+end_src+^D+[ CodeBlock+    ( ""+    , [ "python" , "code" ]+    , [ ( "session" , "py" ) , ( "display" , "plain" ) ]+    )+    "import pandas as pd\ndf = pd.read_csv('weight.csv', parse_dates=['Date'], index_col=0)\n"+]+```
test/command/zeitschrift-fur-kunstgeschichte.csl view
@@ -20,7 +20,7 @@     <category field="humanities"/>     <category field="history"/>     <issn>0044-2992</issn>-    <summary>From the editors: "Die Herausgeber werden im Falle von Editionen, Lexika und Ausstellungskatalogen dem Titel nachgestellt [use encyclopedia articles with or without container-title for that]. Bei gewöhnlichen Sammelbänden werden die Herausgeber dem Titel vorangestellt [use book for that]." Multilingual style; the information for exhibition catalogues should be entered in the field collection-title; locators may use the word "here" or "hier" in front of the page refering to which must be entered individually (the style outputs the locator as it is entered w/o any label or additional text).</summary>+    <summary>From the editors: "Die Herausgeber werden im Falle von Editionen, Lexika und Ausstellungskatalogen dem Titel nachgestellt [use encyclopedia articles with or without container-title for that]. Bei gewöhnlichen Sammelbänden werden die Herausgeber dem Titel vorangestellt [use book for that]." Multilingual style; the information for exhibition catalogues should be entered in the field collection-title; locators may use the word "here" or "hier" in front of the page referring to which must be entered individually (the style outputs the locator as it is entered w/o any label or additional text).</summary>     <updated>2016-02-03T17:41:02+00:00</updated>     <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>   </info>
test/lhs-test.html view
@@ -149,7 +149,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
test/lhs-test.html+lhs view
@@ -149,7 +149,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
test/s5-basic.html view
@@ -14,7 +14,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
test/s5-fancy.html view
@@ -14,7 +14,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
test/s5-inserts.html view
@@ -12,7 +12,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
test/writer.html4 view
@@ -152,7 +152,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
test/writer.html5 view
@@ -152,7 +152,7 @@     code{white-space: pre-wrap;}     span.smallcaps{font-variant: small-caps;}     div.columns{display: flex; gap: min(4vw, 1.5em);}-    div.column{flex: 1;}+    div.column{flex: auto; overflow-x: auto;}     div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}     ul.task-list{list-style: none;}     ul.task-list li input[type="checkbox"] {
trypandoc/index.html view
@@ -175,7 +175,7 @@  <p class="version">pandoc version <span id="version"></span></p> </footer> -<script src="trypandoc.js?202208182155"></script>+<script src="trypandoc.js?202208191048"></script>  </body> </html>
trypandoc/trypandoc.js view
@@ -52,15 +52,16 @@ }  function handleErrors(response) {-    if (response.status == 503 || response.status == 500) {+    if (response.status == 503) {         throw Error("Conversion timed out.")-    } else if (!response.ok) {-        throw Error(response.statusText);+//    } else if (!response.ok) {+//        throw Error(response.statusText);     }     return response; }  function convert() {+    document.getElementById("results").textContent = "";     let text = document.getElementById("text").value;     let from = document.getElementById("from").value;     let to = document.getElementById("to").value;@@ -78,7 +79,11 @@        fetch("/cgi-bin/pandoc-server.cgi", {          method: "POST",          headers: {"Content-Type": "application/json"},-         body: JSON.stringify(params)+         body: JSON.stringify({ from: params.from,+                                to: params.to,+                                text: params.text,+                                standalone: params.standalone,+                                citeproc: params.citeproc })         })        .then(handleErrors)        .then(response => response.text())@@ -95,7 +100,7 @@           document.getElementById("permalink").href = permalink();        })        .catch(error => {-         document.getElementById("results").textContent = error;+         document.getElementById("results").textContent = error        }        );     };