Skip to content

Releases: jgm/pandoc

pandoc 3.12.1

Choose a tag to compare

@jgm jgm released this 08 Oct 01:48
Immutable release. Only release title and notes can be modified.

I'm pleased to announce the release of pandoc 3.12.1,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.12.1

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.12.1

Notable changes:

  • New input and output format: fodt (a flattened representation
    of an ODT in a single XML file).

  • With --citeproc, we no longer extract particles from given and family
    names in structured CSL JSON or CSL YAML references. Thus, for
    example, family: de Gaulle should not create a non-dropping
    particle "de"; "de Gaulle" should be considered the integral
    family name. This is a behavior change that could affect some
    bibliography processing.

  • Fixed a regression in keyword resolution with --syntax-definition.

  • Fixed a serious regression in escaping of data URIs (#11942), which
    broke --embed-resources.

  • Fixed reveal.js version to align with plugin changes from 3.12.

  • Fixed a Markdown reader regression that led to "alerts" not working
    properly.

  • Fixed a regression in rendering of abstracts in ODT.

  • Big performance improvements for XML-based writers and the org,
    man, Textile, MediaWiki, and docx readers.

API changes:

  • Add readFODT to Text.Pandoc.Readers.ODT.

  • Add writeFODT to Text.Pandoc.Writers.ODT.

Thanks to all who contributed, especially new contributors
Aslak Hellesøy, Erik Demaine, Raffaele Mancuso, Kyohei Takahashi,
and rca-umb.

Click to expand changelog
  • New input and output format: fodt (#4010). This is ODF’s “flat” representation of a text document: a single XML file instead of a zip package (ODT). It supports the same options as odt, including --reference-doc (which should be a zipped odt) and --link-images.

  • Resolve keywords after loading a syntax definition (#11921, #11923). This fixes a 3.12 regression in --syntax-definition that was due to a change in skylighting. As the skylighting changelog indicates, users must now apply resolveKeywords after parsing a syntax definition.

  • With --citeproc, we no longer extract particles from given and family names in structured CSL JSON or CSL YAML references (#11911). Thus, for example, family: de Gaulle should not create a non-dropping particle “de”; “de Gaulle” should be considered the integral family name. This is a behavior change that could affect some bibliography processing.

  • Commonmark reader:

    • Make task lists work in commonmark_x. Previously task_lists would not work if fancy_lists was enabled, for any commonmark variant.
  • Markdown reader:

    • Put alert after tip, etc. in classes (#11919). Some of the writers (gfm, docbook, asciidoc, rst) check for the admonition name as the first class, so the change putting alert first broke the output. (Regression from 3.12.)
    • Don’t trim spaces in inline span. Previously we trimmed the space in e.g. [ test ]{.class}. This behavior has no good rationale, and it made it impossible to represent insertions and deletions properly.
    • Make lookahead for setext header line more efficient.
  • Docx reader:

    • Keep bookmark when stripping caption label (#11918). This allows us to preserve internal links to figures.
    • Add map of table styles to the reader environment.
    • Fix double strikethrough being dropped (Kyohei Takahashi). w:dstrike was not parsed at all, so text marked with Word’s double strikethrough was read as plain text, with no indication that it had been struck out. Treat it as Strikeout.
    • Keep spaces at the edges of tracked changes in the span (#11904, Raffaele Mancuso). This is important for tracking insertions/deletions.
  • ODT reader:

    • Don’t crash on a table with no rows.
    • Don’t loop forever on cyclic style inheritance.
    • Make getStyleFamily linear in the inheritance depth. A style whose family had to be inherited took time exponential in the chain length.
    • Cap the number of spaces produced by text:s. text:c is unbounded in ODF, so <text:s text:c="200000000"/> let an 832-byte document allocate until the OOM killer stepped in.
    • Keep the set of used anchors in the reader state.
    • Look up used anchors in a Set in uniqueIdentFrom.
    • Keep the archive’s media in a Map rather than an association list.
    • Attach table captions wherever they occur. post_process' matched a table followed by a caption only at the very head of the block list and then stopped, so a caption was picked up only if its table was the first block of the document; anywhere else the caption was dropped and the internal marker Div leaked into the output. Walk the whole document instead, so captions nested in sections, cells and list items are found too. Accept the caption before its table as well as after it.
    • Don’t add a bogus media entry for a missing image.
    • Only treat font weights of 700 and up as bold. Every numeric fo:font-weight from 100 to 900 was mapped to bold, so text in a hairline or light weight was read as Strong.
    • Read text wrapped in metadata elements and fields. Content of an element the reader did not recognize was discarded along with the element, which silently lost text: fields such as text:page-number, text:author-name or text:chapter, the RDFa wrapper text:meta, the bibliographic wrapper text:meta-field, and ruby annotations. Add matchers for those; for ruby, keep the base text and drop the gloss, which pandoc cannot represent.
    • Honour table:number-{columns,rows}-repeated. ODF abbreviates a run of identical cells or rows with a repeat count. The reader ignored both counts, so a row of five cells written as three elements came out three cells wide. Also count a cell spanning several columns as occupying all of them when working out the number of columns, rather than as one.
    • Read rows wrapped in table:table-row-group. Rows need not be immediate children of the table.
    • Read blocks nested in list items, footnotes and cells. ODF allows the same block-level content wherever it allows a paragraph, but the reader spelled the list of block matchers out separately at each site and each spelling was missing something: a table in a list item was dropped, a list or table in a footnote was dropped, and a heading or nested table in a table cell was dropped. Keep a single list and use it everywhere, so the sites cannot drift apart again.
    • Read images embedded in office:binary-data.
    • Read MathML embedded inline in draw:object. A flat OpenDocument file cannot refer to a separate formula document, so the MathML is a descendant of the draw:object instead.
    • Add readFODT for flat OpenDocument input [API change].
    • Fix formula lookup when the href has a trailing slash.
    • Trim the alt text of an image.
    • Look up the image mime type on the draw:image element instead of guessing from magic bytes.
  • RTF reader:

    • Combine UTF-16 surrogate pairs (#11920).
  • Typst reader:

    • Do not emit mixed table column widths (#11898, Samuel Huang). Previously we evenly split the remaining width, but generally it looks better just to make every column auto if any column is default width.
    • Treat zero-width table fractions as unspecified (#11898, Samuel Huang).
  • Org reader:

    • Improve performance: use a jump table to find the end of plain text runs, and dispatch on the next character in inline.
  • Creole reader:

    • Use jump tables to find the end of plain text runs.
    • Use takeWhile1P in str.
  • RST reader:

    • Use takeWhile1P for raw field list items.
  • Textile, Vimwiki, MediaWiki, Txt2Tags readers:

    • Use jump tables to find the end of plain text runs.
  • Roff readers:

    • Use takeWhile1P for regularText.
  • Mdoc reader:

    • Use takeWhile1P in lexer.
  • Docx writer:

    • Use table style id in the tblStyle element (#11932). Previously we used the table style name. This happened to work for the default table style, but only because its name and id matched. It failed for custom styles whose names did not match their ids.
    • Put a heading’s bookmark in its paragraph (Robert Szarka, #11845, cf. #8825). The bookmark for a section’s id surrounded the whole section, at body level, so a screen reader met it at the section’s last line rather than at the heading. Moreover, the docx reader looks for bookmarks only inside paragraphs, so the ids did not round-trip.
    • Improve highlighting of marked spans containing math (#11885, Samuel Huang).
  • OpenDocument writer:

    • Use literal instead of text . T.unpack.
    • Emit whitespace runs in one piece.
    • Count styles and notes in O(1).
    • Give nested notes distinct ids.
    • Use valid column style names past column 26 (AA, AB, etc.).
    • Apply the requested style to Plain blocks. withParagraphStyle only wrapped Para in a paragraph with the requested style; a Plain fell through to blockToOpenDocument and came out with the default style.
    • Render the abstract as blocks. The abstract was wrapped in a Div with custom-style set to Abstract, but then handed to metaToContext, which renders metadata fields with the inline writer. The style was lost, as well as any block-level formatting. Regression from 013351f.
    • Reuse identical automatic paragraph styles. Every blockquote, every explicitly aligned table cell, and every direction-adjusted style got a fresh Pn automatic style, even when an identical one already existed.
    • Look up cross-reference targets in a Map. Skip the collecting walk altogether unless xrefs_name or xrefs_number is enabled, since nothing reads the result otherwise and neither is on by default. Elements with an empty identifier are no longer collected, so a link to “#” can no longer resolve to a reference with an empty ref-name.
    • Sort automatic text styles numerically rather than alphabetically (T9, `T...
Read more

pandoc 3.12

Choose a tag to compare

@jgm jgm released this 29 Sep 06:30
Immutable release. Only release title and notes can be modified.

I'm pleased to announce the release of pandoc 3.12,
available in the usual places:

Binary packages & changelog: https://github.com/jgm/pandoc/releases/tag/3.12

Source & API documentation: http://hackage.haskell.org/package/pandoc-3.12

This release focuses on performance. Here are some benchmarks showing
the improvement since pandoc 3.10.2:

benchmark-comparison

There shoud be even more dramatic gains in image-heavy documents, because
of optimizations in ImageSize.

In addition to performance improvements, there are many other small
improvements and bug fixes. See the changelog for full details.
Most of the performance gains and and many of the bugs were found
with the help of Claude Fable.

API changes:

  • Text.Pandoc.ImageSize: ImageType now derives Eq.
  • Text.Pandoc.Sources: new functions takeWhileP, takeWhile1P.
  • Text.Pandoc.Shared: new functions stringifyInlines,
    compactifyTable. FromText constraint added to the signatures
    of htmlAttrs and tagWithAttrs.

Other changes of note:

  • -t xml now respects --standalone, and produces a
    fragment (just the blocks) if it is not provided, like -t native.
  • The default CSS now includes dark mode support.

Thanks to all who contributed, especially new contributors
Andonome, Clar Fon, Gaurav Vijay Jadhav, Robert Szarka,
Samuel Huang, Yusuf Efe, and zenor0.

Click to expand changelog
  • Markdown reader:

    • Make alert keywords case-insensitive (#11836, Hendrik Erz). In addition, the class alert is now added to the produced Divs.
    • Fix stream position handling in base64DataURI.
    • Cheaply reject bareURL before trying uri/emailAddress.
    • Reset sourcepos in parseWithString' when parsing a block quote or list item. Otherwise it can happen that by the time parseWithString' is called, the position has already been set to the next file on the command line. Fixes an odd bug with rebase_relative_paths (#11888).
    • rebase_relative_paths: recognize URLs with unknown schemes (#11858).
    • Use takeWhile1P in the hot inline parsers str, code, enclosure, and mmdShortSubscript.
    • Reset sourcepos in parseWithString' when parsing a block quote or list item (#11888). This ensures that rebase_relative_paths will see the right source file.
  • Typst reader:

    • Map form: "prose" citations to AuthorInText (#11846, Samuel Huang).
    • Make the handler maps monomorphic by wrapping the handlers in newtypes with polymorphic fields (BlockHandler, InlineHandler).
    • Store document labels in a Set instead of a list.
    • In pInline, only perform the label-target check for ref elements, not for every inline element.
    • Handle highlight as a mark span (#11879, Samuel Huang).
    • Collapse citations around soft break (#11897).
    • Handle block content in inline element bodies (#11881, Samuel Huang).
    • Handle #par (explicit paragraph element).
  • LaTeX reader:

    • Support LaTeX3 (xparse) document commands (#7540). Support the features described in the LaTeX usrguide.
    • Fix \qed to produce U+00A0 (nbsp) instead of BEL.
    • Fix unescapeURL handling of escaped backslash.
    • Require that \newif names begin with “if”.
    • Fix position off-by-one after ## in tokenizer.
    • Fix doubled source positions in retokenizeComment.
    • Make raw token capture O(1) per token.
    • Make untokenize linear instead of quadratic.
    • Fail macroDef fast on non-macro-defining commands.
    • Peek at next token directly in peekTok instead of going through satisfyTok.
    • Skip doMacros state update for non-macro tokens.
    • Build command dispatch maps (inlineCommands, etc.) once per parse.
    • Keep ASCII quotes when ligatures are disabled.
    • Don’t discard state changes made in optional arguments.
    • Keep nested conditionals balanced in \iftrue etc.
  • Docx reader:

    • Read ScreenTips as link titles (#11869, Robert Szarka).
    • Use comment-id instead of id in AST for comments.
  • ODT reader:

    • Rewrite in monadic style. Net -994 lines. No changes to test output.
    • Handle textProperties on paragraph styles (#2623). Previously these just got ignored, not applied to the paragraph’s text.
  • HTML reader:

    • Don’t require a closing tag for checkbox inputs. <input> is a void element.
    • Allow omitted </tr> in tables. The </tr> closing tag is optional in HTML.
    • Don’t drop cells when there are too few <col> elements.
    • Let the first of duplicate attributes win. HTML specifies that the first occurrence wins.
    • Respect raw_html for inline <style> elements.
    • Use a Map for the note table.
    • Report the noteref position for unresolved notes. The ReferenceNotFound warning was logged after the whole document had been parsed, so it always pointed at the end of the input. Record the position of the first reference to each note and use it in the warning.
    • Find list style anywhere in the class attribute. Previously <ol class="fancy lower-roman"> got DefaultStyle, because the whole class attribute was compared against the known style names. Check each class individually. As a side effect, an unrecognized class no longer prevents falling back to the style attribute.
    • Limit iframe nesting depth.
    • htmlTag: Don’t copy the remaining input on each invocation. A space was appended to the remaining input to guarantee a TagPosition token after the parsed tag; since the input is a strict Text, this copied the entire remaining input every time htmlTag was called (e.g. for every inline HTML tag in a markdown document), giving quadratic behavior in tag-dense documents. Instead, handle the case where the tag is the final token by computing the end-of-input position directly.
    • Pass the tag name to pSpanLike. The inline dispatcher already knows which span-like element it is looking at, so there is no need for pSpanLike to try a parser.
    • Fix pre/code attribute precedence for first-wins dedup.
    • Implement pSatisfy as a single parsec primitive.
    • Add a fast path to pTagText: when the text contains no character that could parse as anything but Str, Space, or SoftBreak under the enabled extensions (and we are not in a pre element), return B.text directly.
    • Reorder pTagContents to try pStr and pSpace before the math, smart punctuation, and raw TeX parsers. This is safe because pStr cannot consume the special characters that start those parsers, and it avoids most guard checks on the slow path. This makes the html reader benchmark about 33% faster and halves its allocation.
  • Muse reader:

    • Try str earlier in inline parser. This makes the reader 2x faster and reduces heap allocation by 60%.
    • Check raw line before parsing table rows. Table row parsers are speculatively tried at every paragraph line boundary via the terminator continuation. This change gives another 2x speed improvement.
  • Org reader:

    • Fix hard parse failure on bare backslash.
    • Recognize .pdf as an image format (#11859). This matches the behavior of Emacs, which will render [[file:foo.pdf]] as an image.
    • Make #+OPTIONS: ^:nil disable all sub-/superscript parsing.
    • Allow - and _ in inline footnote labels. Org footnote labels may contain word-constituent characters, hyphens and underscores.
    • Fix swapped arguments in exportSettings parser.
    • Don’t lowercase meta keyword twice.
    • Avoid quadratic complexity when parsing table rows. Parsing a 32000-row table drops from 7.8s to 0.9s (and scales linearly instead of quadratically); maximum residency also improves.
    • Use a Set for anchor ids. Reading a document with 64000 anchors and as many internal links drops from 23.5s to 5.2s and now scales linearly.
  • RST reader:

    • Use a predicate to test for for special characters.
    • Avoid double-parsing lines preceding a non-underline.
    • Fail fast when no link can start at this position.
    • Use lookupGE to find the next anonymous key. Parsing a document with 16000 anonymous links drops from 5.2s to 2.0s.
    • Replace association list with Map for resolving note references. Parsing a document with 16000 named notes drops from 5.8s to 3.5s, and scaling is now linear.
    • Fix a bug that led to an empty class for code blocks with no specified language.
  • CommonMark reader:

    • Avoid nested walks in tex_math_gfm handling.
    • Avoid rebuilding the token list with map id in sourceToToks in the common case where the source starts at line 1.
  • AsciiDoc reader:

    • Resolve footnotes, stem, and icons during conversion. Previously the reader made three separate passes over the parsed AsciiDoc AST (for footnotes, stem math types, and icons) before converting to the pandoc AST. Instead, resolve all three during the toPandoc conversion, which already traverses everything once, threading footnote state and document attributes through a StateT layer. Table headers are now converted before body rows so that footnote resolution follows document order. This makes the reader about twice as fast on typical documents.
  • Djot reader:

    • Fix a bug that led to an empty class for code blocks with no specified language.
  • Vimwiki reader:

    • Split class attribute and put it in the proper slot in pandoc’s Attr.
  • Typst writer:

    • Omit blank line at end of block (#11844). This is just a cosmetic change; it is not semantically significant.
    • Emit label for bare table if present (#11849). Previously a label was only emitted if the table was figurized (and not .typst:no-figure).
  • RST writer:

    • Apply nowrap to just footnote label, not body. This bug surfaced after nowrap was fixed in doclayout.
  • Docx writer:

    • Fix sizing for images (#11838). Setting size to a percent now scales image to p...
Read more

pandoc 3.11

Choose a tag to compare

@jgm jgm released this 29 Aug 00:52
Immutable release. Only release title and notes can be modified.
I'm pleased to announce the release of pandoc 3.11,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.11

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.11

Some changes of note:

- A new `--math-method` option, which replaces the (now deprecated but
  still functional) options `--mathml`, `--mathjax`, `--gladtex`,
  `--katex`, `--webtex`. The `plain` style can now be specified
  explicitly. In defaults files, `html-math-method` is now
  `math-method` (though `html-math-method` will still work).

- `mathml` is now the default math-method.

- A new option `--completion={bash,zsh,fish}` generates completion
  scripts for all three shells (see the manual for instructions on
  how to use them). `--bash-completion` continues ot work, an alias of
  `--completion=bash`.

- It is now possible to reset a Markdown example list counter (e.g.,
  at the beginning of a chapter), using the syntax `(1@)` or
  `(1@label)`.

- Enhanced support for RTL languages: RTL text direction now
  works in ODT. In addition, setting `lang` at the document level
  is now sufficient in Docx to make documents RTL.

- Fixed pandoc 3.8 regressions in syntax highlighting.

- Fixed a security-related bug in template fetching which
  could result in a local file being fetched instead of a
  remote one.

API changes:

- Text.Pandoc.Options: Rename HTMLMathMethod type to MathMethod.
  Rename `writerHTMLMathMethod` field of WriterOptions to
  `writerMathMethod`.

- Text.Pandoc.App: the `optHTMLMathMethod` constructor for OPt
  is renamed to optMathMethod.

Thanks to all who contributed, especially new contributors Wrong-Code
and wzy.
Click to expand changelog
  • Add --math-method option. This replaces (now deprecated but still functional) options --mathml, --mathjax, --gladtex, --katex, --webtex. The plain style can now be specified explicitly. In defaults files, html-math-method is now math-method (though html-math-method will still work).

  • Make mathml the default math-method (#11751).

  • Add --completion={bash,zsh,fish} (#8542, wzy). Make --bash-completion an alias of --completion=bash. See the manual for instructions on how to use these completions.

  • Text.Pandoc.Options [API change]:

    • Rename HTMLMathMethod type to MathMethod.
    • Rename writerHTMLMathMethod field of WriterOptions to writerMathMethod.
  • Markdown reader:

    • Add a syntax (1@label) for resetting example list counter (#10940). This is needed often at the beginning of a chapter.
  • MediaWiki writer:

    • Put <nowiki> around possible URLs (#11834). Otherwise they get linkified automatically.
  • Docx reader:

    • Handle case where non-header rows come before header rows (#11833).
    • Improve handling of tables with uneven rows (#11833).
  • RTF Reader:

    • Add support for nested tables (#11218, Alex).
  • Typst reader:

    • Remove handling of ‘block’ as an inline-level element (#11814).
  • HTML reader:

    • Handle pre without code (#11810). Preserve whitespace as nonbreaking spaces.
  • ODT/OpenDocument writers:

    • Support RTL text direction (#11301). RTL is now properly handled in these cases: dir: rtl (or ltr) in document metadata; an RTL lang in metadata (e.g. he, ar), unless overridden by dir; a dir attribute on a Div. Code blocks remain ltr regardless.
    • Use style:language-complex rather than fo:language for RTL languages (#11301).
    • Fix treatment of DefaultHighlighting (#11829).
  • Docx writer:

    • Initialize envLang from lang metadata (#11301). This ensures that setting lang will affect the whole document. Previously, setting lang to he was not sufficient to make the document RTL.
  • JATS writer:

    • Fix illegal use of p element inside p (#11809).
  • Ms writer:

    • Fix treatment of DefaultHighlighting (#11829). (Regression from 3.8.)
  • ConTeXt writer:

    • Fix bug in syntax highlighting (#11829). (Regression from 3.8.)
  • Text.Pandoc.App.Opt:

    • In Opt, change optHTMLMathMethod to optMathMethod. [API change]
  • MSI installer: Fix upgrade detection for per-machine installations (#11827, Wrong-Code). Previously, registry records of previous versions were not being removed.

  • Text.Pandoc.Templates:

    • Fix bug in getTemplate. When calling fetchItem in getTemplate, we temporarily reset the stSourceURL in CommonState so that the template is sought locally. Previously, an exception in fetchItem would prevent stSourceURL from being set back to its original value. This could result in a local file being fetched instead of a remote one. Note that an exception is triggered when one uses e.g. --template default.html5; in that case getTemplate handles the exception by looking for the file in the user data directory. This patch fixes the bug so that the stSourceURL is reset regardless of whether fetchItem raises an exception. Thanks to Yingjie Su for identifying the problem.
  • beamer template: remove spurious extra tableofcontents (#11819).

  • Text.Pandoc.App.CommandLineOptions:

    • Export OptionSpec, which can encode the type of completion needed by each option (wzy).
  • Add new unexported module Text.Pandoc.Completion (wzy).

  • Replace a use of nub with nubOrd.

  • Use latest releases of djot, asciidoc, typst, texmath.

  • MANUAL.txt:

    • Add a note that thanks in typst doesn’t currently work (#11807).
    • Note that sourcepos extension works for djot too.

pandoc 3.10.2

Choose a tag to compare

@jgm jgm released this 12 Aug 19:05
Immutable release. Only release title and notes can be modified.
I'm pleased to announce the release of pandoc 3.10.2,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.10.2

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.10.2

This release fixes some bugs, including a couple of regressions.
One relates to conversion of quotation marks in typst output; the
other fixes parsing of math containing `	ag`, `label`, or comments.

There is one new feature: a `typst-label` attribute on a Div,
Table, Figure, or Header will be used to construct a label
in typst output.

In addition, pandoc.wasm should now be useable with wasmtime.

No API changes, but bumpting third digit because of the `typst-label`
behavior change.

Thanks to all who contributed, especially new contributors Philipp Gillé
and gemmaro.
Click to expand changelog
  • Markdown reader:

    • Raw HTML: fix handling of void hr element (#11793).
  • LaTeX writer:

    • Omit empty caption on unnumbered tables (#11795).
    • Emit accumulated footnotetext at the first available opportunity (#11773).
  • Typst writer:

    • Don’t alter curly quotes in strings, even with smart (#11788). This reverts commit 0484840.
    • Make writer sensitive to typst-label attribute (#11794). If this attribute is set, the writer will output a label. (This overrides labels based on identifiers, when identifiers are present.)
  • Typst template: rename horizontalrule to horizontalRule , so it matches the polyfill. (#11784, Ian Max Andolina).

  • Text.Pandoc.Readers.HTML.TagCategories (unexported): export voidTags.

  • epub.css: Add support for dark mode (k6G52m4Dz75W).

  • WASM build: restore legacy exception handling, for compatibility with wasmtime (#11787).

  • Use new release of asciidoc (fixing problems with row/colspans and footers in tables).

  • Use new release of texmath (fixing problems with equations containing \tag, \label, or comments).

  • MANUAL.txt: Correct Asciidoctor name casing (gemmaro, #11782).

  • INSTALL.md: Update Fedora link to pandoc-cli package (#11798, Philipp Gillé).

  • CONTRIBUTING.md: remove suggestion to submit Lua filters (#11800).

  • Add doc/twenty-years-of-pandoc.md.

  • Changelog - fix pandoc 0.1 release date.

  • Add release-announcements.txt (scraped from pandoc-announce).

pandoc 3.10.1

Choose a tag to compare

@jgm jgm released this 22 Jul 17:34
Immutable release. Only release title and notes can be modified.
I'm pleased to announce the release of pandoc 3.10.1,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.10.1

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.10.1

This release contains many small improvements and bug fixes.
Some of the more notable ones are mentioned here (see the changelog
for details):

- t2t (Txt2Tags markup) is now an output format.
- It is now possible to use a defaults file without an
  extension; pandoc will add the .yaml extension only if
  no file exists with the name specified.
- The auto_identifiers extension may now be used with typst input.
  (however, it is not enabled by default.)
- We now use '#divider()' (typst 0.15) for typst horizontal rules,
  instead of defining our own horizontalRule function.
- It is now finally possible to force LaTeX to use a regular
  floating table rather than a longtable, which is especially
  important for two-column layouts (longtable does not
  support them). One does this by adding the `float` class
  to the table's attributes.
- starmath is now used instead of MathML for math in ODT.
  This produces much better results and improves the editability
  of equations.
- We now automatically enable auto_identifiers when a table of contents
  is requested, since these require identifiers to link to.
- A new flake.nix allows use to use 'nix build' and 'nix run'
  with pandoc.

API changes:

New module Text.Pandoc.Writers.Txt2Tags, exporting writeTxt2Tags,
also re-exported by Text.Pandoc.Writers.

Thanks to all who contributed, especially new contributors
Can H. Tartanoglu, Chirag Dhamange, Enrico Spinielli,
Robertas, Scott Talbert, Tobias Deiminger, luginf.
Click to expand changelog
  • New output format t2t (Txt2Tags markup, https://txt2tags.org)) (luginf).

  • New module Text.Pandoc.Writers.Txt2Tags, exporting writeTxt2Tags (loginf) [API change]. Also exported from Text.Pandoc.Writers.

  • Change adding of .yaml extension in --defaults option (#11717). Previously it was always added if the specified filename lacked an extension. Now it is only added if there is no file with the original name. This facilitates using --defaults with bash/zsh <(..) or =(..).

  • RST reader:

    • Fix nested placeholder resolution for inline elements (#11753, Tobias Deiminger). (Regression from pandoc 3.6.)
    • Treat undefined substitution references as plain text (#11727). This mirrors rst2html behavior.
  • Markdown reader:

    • Ordered sublists must start with 1, er equivalent, e.g. i (#11735). This brings the markdown parser in line with commonmark, and avoids a lot of unintended list starts. Note that ordered lists that are not sublists may still start with numbers other than 1.
  • ODT reader:

    • Don’t create Emph just because of changed font (#11691).
  • RTF reader:

    • Support multi-paragraph list items.
    • Support legacy \pn/\pntext paragraph numbering (#11686).
  • Docx reader:

    • Improve horizontal rule detection (#11689).
    • Key list numbering off abstractNumId, fixing numbering for restarted lists (#8367).
  • LaTeX reader:

    • Handle \hypertarget with one braced parameter (#7418).
  • DokuWiki reader:

    • Skip non-cell content after table row (#11739).
  • Typst reader:

    • Support auto_identifiers extension (#11041). The extension is available for the typst reader but is off by default; enable it with -f typst+auto_identifiers. The related gfm_auto_identifiers and ascii_identifiers extensions are also made available.
    • Recognize divider() for horizontal rule (#11540).
  • HTML reader:

    • Fix unused variable warning in CI (#11704, Robertas).
    • Strip language- from all classes, not just first (#11701). Also combine classes from both code and pre class if they are nested.
  • Powerpoint writer:

    • Keep tables and surrounding text on same slide (#11433, Chris Callison-Burch). Previously, when a slide contained bullet points before and after a table, content would be split across multiple slides or use a two-column layout that didn’t preserve the source order.
  • Texinfo writer:

    • Fix spacing bug around HorizontalRule (#11749).
    • fix escaping in links (#11758). Previously we dropped periods, commas, etc. This was a regression from 2024. All we really need to do is escape the comma.
  • LaTeX writer:

    • Provide a way to use table instead of longtable (#1023). When the float class is attached to a table, a standard floating table will be generated instead of a longtable. Placement can be specified via the latex-placement attribute. This will help, especially, those who use two-column layouts, since longtable is incompatible with these.
    • Fix footnotes in definition list headings (#8240).
  • Markdown writer:

    • Fix ordered list indentation bug (#11762).
    • Improve identification of code language class by looking it up in the syntax map (#11701).
    • In YAML metadata, put double quotes around strings that are numbers beginning with 0 or ending with 0 and having a decimal point (#11715). Otherwise they will read as YAML numbers and potentially be modified (e.g. 3.10 -> 3.1).
  • Docx writer:

    • Use namespace URI instead of prefix in extractPageLayout (#11697, Robertas).
  • ODT writer:

    • Use starmath for math. This improves appearance and editability of equations. The main code changes are due to @jdpipe (#11470).
    • Image anchoring, percent dimensions, text width resolution (#11746, Can H. Tartanoglu). Inline images now emit text:anchor-type=as-char on their draw:frame, anchoring the frame as a character so it flows with the surrounding text. When both width and height are given and the width is a percentage, the width is now resolved against the reference document text area width, mirroring how the docx writer derives its print width from the reference docx section properties. The height follows the aspect ratio.
  • RTF writer:

    • Emit real RTF lists with a list table. Lists were written as plain paragraphs with a literal marker and a hanging indent, carrying none of the \ls/\ilvl references or the \listtable/\listoverridetable that the RTF list model (and pandoc’s own reader) expect, so lists could not round-trip.
    • Allow fontsize to be specified (#11750). The fontsize is specified in a variable or metadata field and passed through the renderer via a Reader monad.
  • Typst writer:

    • Fold lang into pickTypstAttributes (#11673). This ensures that lang attributes will be set for both Divs and Spans.
    • Add support for tight terms in Typst writer (#11748, Amir Dekel). This just affects whether a blank line is emitted in the markup. Note that pandoc’s default template contains a show rule for terms that will make these blank lines irrelevant, but this change allows one to use tight lists with custom templates.
    • Further tight term list improvements. For tight list items consisting of just one Plain block, we no longer create a #block for the definition; this allows it to remain on the same line as the term.
    • Emit divider() as horizontal rule (#11540).
  • LaTeX template:

    • The caption package is included and a default spacing set between the caption and the table.
  • Typst template:

    • Remove custom show rule for terms. Instead, we use a set rule to set hanging-indent.
    • Remove old horizontalRule definition from default template.
    • Polyfill divider for typst < 0.15.
    • Allow multiword keywords (#11730, Albert Krewinkel). Typst expects single words as keywords, so keywords consisting of multiple words must be quoted (and should not be wrapped).
  • HTML template:

    • Remove hard-coded font-size for print CSS. Print CSS now uses the inherited font-size.
  • epub.css:

    • Get rid of obsolete #TOC rules (#11747). We don’t generate anything with the TOC id in epubs. A table of contents is in nav#toc and we have rules for that.
    • Put clause for all headings before individual h1, h2, … (#11742). This is more logical, since the individual clauses are meant to override.
  • Text.Pandoc.Shared:

    • Improve makeSections (#11745). Previously it would sometimes create doubled section divs. By leaving the inner heading’s id on the heading itself, and then consolidating the inner and outer section divs, we can avoid this undesirable result.
    • taskListItemToAscii: handle empty task list case.
    • taskListItemFromAscii: handle empty task list case (#11599, Chirag Dhamange).
  • Text.Pandoc.App.CommandLineOptions:

    • Use optCSL and optBibliography from Opt (#11741). Previously we set optMetadata directly, but that had some unintended effects, especially in interacting with defaults files. With this change, a --csl on the command line can override one set in a prior defaults file.
  • Text.Pandoc.App:

    • Enable auto_identifiers when a table of contents is requested (#11041). Table-of-contents entries link to heading identifiers, so when --toc/--table-of-contents is given, force the auto_identifiers extension on for the input format even when it is off by default (as it now is for typst). This makes typst-to-markdown --toc produce working links.
  • Text.Pandoc.Writers.Shared:

    • htmlAttrs - don’t add data- prefix for markdown (#11685). This is necessary for the markdown_attribute extension to work properly.
  • Ensure that IO error messages go to stderr (#11710).

  • Use emojis 0.1.5, texmath 0.13.2,typst 0.11, typst-symbols 0.3, pandoc-types 1.23.1.2, djot 0.1.4.1, commonmark-extensions 0.2.7.1, skylighting-format-blaze-html 0.1.2.1.

  • Add Makefile rule to update all-cabal-hashes in flake.lock.

  • MANUAL.txt:

    • Clarify comment about table types (#11719).
    • Small clarification in image section (#11760).
    • Rewrite “A note on...
Read more

pandoc 3.10

Choose a tag to compare

@jgm jgm released this 04 Jun 16:31
Immutable release. Only release title and notes can be modified.
I'm pleased to announce the release of pandoc 3.10,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.10

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.10

In addition to the usual basket of bug fixes and small improvements,
the following changes are worth mention:

- This release adds a --typst-input option, which allows passing
  arbitrary `sys.inputs` parameters to the typst evaluator.

- groff is now the default pdf-engine for the ms format, replacing
  pdfroff.

- The auto_identifiers extension (and related extensions) are
  now available for the man reader.

- OpenDocument/ODT now uses predefined styles instead of emitting
  automatic styles for every paragraph. This yields more idiomatic,
  and more easily stylable, output, resolving a handful of longstanding
  issues. If you use a custom reference.odt, it may need some updating.

API changes:

- Text.Pandoc.App.Opt: Opt has a new fieldi optTypstInputs.
- Text.Pandoc.Options: ReaderOptions has a new field readerTypstInputs.

Thanks to all who contributed, especially new contributors Dan Jacobson,
Johan Larsson, Keenan Brock, Meher Chaitanya, Sai Asish Y, and nibras shami.
Click to expand changelog
  • Add --typst-input CLI option (#11588). This allows one to pass parameters to typst, which are available at sys.inputs, just as typst itself does with its --input option.

  • Avoid trailing spaces in --help output (#11623).

  • Make groff the default pdf-engine for ms output (#11558). Formerly it was pdfroff.

  • Set default User-Agent request header to pandoc/VERSION. This can be overridden using the --request-header option.

  • Markdown reader:

    • Allow grid tables to be indented (#11671, Johan Larsson). Like the other table syntaxes (pipe, simple, and multiline tables) and block-level constructs generally, a grid table may now be indented by up to three spaces and still be recognized as a table. Previously the grid-table parser required the table to begin at the left margin, so an indented grid table was parsed as a paragraph.
    • Fix calculation of column widths for default columns in grid tables (#11664). This fixes a bug which produced too-narrow columns in some cases.
    • Don’t produce empty Raw element with --strip-comments (#11625).
    • Fix quotes in inline notes (#11613, Andrew Dunning).
    • Allow spaces inside attributes in super/sub (#11589).
    • Simplify checkNotes, remove dead code
    • Various small performance optimizations.
  • HTML reader:

    • Parse aside as a Div with class “aside” (instead of using raw HTML) (#11626).
    • Add “header” class to Divs created from headers.
  • Docx reader:

    • Fix bug in bitmask checking (#8299). This led to some table rows being wrongly considered header rows.
    • Improve treatment of tblHeader element (#8299). If tblHeader exists but has w:val="0", then don’t consider the element a header.
    • With citations extension, prefer citation-key as the key for item data, if it is defined (#11581; cf. #10366, #11567). The id key used by Zotero is not exposed by their API and is generally not what is wanted when converting to biblatex.
    • Don’t look to ext tags for image extent (#11580). This reverts a change from 7ff1b79. The change was mistaken and could cause images to be parsed with the wrong sizes.
  • Man reader:

    • Support auto_identifiers, gfm_auto_identifiers, and ascii_identifiers extensions (#8852, Meher Chaitanya). Section headings parsed from .SH and .SS macros now receive auto-generated id attributes when the extension is enabled (as it is by default). This enables --toc to produce working anchor links.
    • Better handling of .TP macro (#11668). We parse these as DefinitionList items, but we previously sometimes stopped prematurely in including material in the definition. We should include everything until we hit a new indentation-changing macro.
  • Roff reader:

    • Handle \ line continuation in table cells (#11635).
  • LaTeX reader:

    • Evaluate theorem name when used rather than evaluating it when the \newtheorem command is encountered (#11608). It may include macros only defined later.
    • Put identifier from label on table attributes rather than adding an enclosing Div (#11604).
  • Typst reader:

    • Fix issue parsing figure inside rotate or box (#11598).
    • Implement “rotate” as pass-through (#11531). Information about the angle is encoded in an attribute of an enclosing span or div.
  • RTF reader:

    • Fix tables parsed as deeply nested tables (#11682).
  • Docx writer:

    • Fix display of paragraph with just inline math (#11674). Word displays a paragraph containing just one inline math element as if it were display math. We don’t want that, so we add a zero-width space to defeat this behavior.
    • Fix FirstParagraph style lost after heading with footnote (#11573).
    • Fix empty keywords in core document properties (#11666, Sai Asish Y).
  • OpenDocument/ODT writer:

    • Use predefined styles (#9316, #5086, #2747, #3426, #7336). Previously the OpenDocument writer emitted a fresh automatic style (L1..Ln, P1..Pn, T1..Tn) for nearly every list, list-item paragraph, block quote, preformatted block, and inline text style. This commit teaches the writer to reference the predefined styles that LibreOffice ships and that pandoc’s reference.odt now exports:

      • Bullet lists use List_20_1; ordered lists with default start and decimal format use Numbering_20_1. Non-default ordered lists generate a single named override style (Pandoc_Numbering_N) memoised by (ListNumberStyle, ListNumberDelim); a non-default start value with the default format is expressed via text:start-value on the text:list element instead of a new style.
      • List-item paragraphs use List_20_Bullet[_Tight] and List_20_Number[_Tight]. The Tight variants are pandoc-specific (zero top/bottom margin) and are injected into the user’s reference.odt if missing, just like the Skylighting token styles.
      • Block quotes use the predefined Quotations paragraph style directly. Nested block quotes use a single automatic style that inherits from Quotations and only adds extra margin-left, so a list inside a block quote now inherits its container’s indent (#2747).
      • Preformatted blocks use Preformatted_20_Text directly.
      • Emphasis, Strong, Strikeout, Subscript, Superscript and Code spans use the predefined Emphasis, Strong_20_Emphasis, Strikeout, Subscript, Superscript and Source_20_Text text styles.
      • paraStyle/paraStyleFromParent no longer emit a wrapper automatic style when its only attribute would be parent-style-name; the parent name is returned directly.
  • EPUB writer:

    • Support multiple EPUB versions for raw content (#11628, nibras shami). This change ensures that raw content marked epub2 will appear in (only) EPUBv2 output and content marked epub3 will appear in (only) EPUBv3 output.
  • Typst writer:

    • Add zero-width space before a Span label if otherwise the label doesn’t come after anything (#11568). (In this case typst will raise an error.)
    • Add newline after #set text directive (#11583). This ensures that blocks such as lists are parsed correctly after a set text.
  • LaTeX writer:

    • Fix fr-CA babel language mapping (#11575, Christophe Dervieux). Map fr-CA to french instead of deprecated canadien. The babel-french package’s canadien.ldf is deprecated and broken: it never calls \ldf@finish, so \bbl@main@language is left undefined, causing babel to crash at \begin{document}. Since canadien was always just an unconditional alias for french, use french directly.
  • MediaWiki writer:

    • Handle some technically malformed URLs (#11562).
    • Fix escaping to avoid accidental lists (#11563).
  • Markdown writer:

    • Fix spacing issues with definition lists.
      • Properly handle the case where the first item is an indented code block (#11542).
      • Use correct indentation when four_space_rule extension is disabled.
    • Escape ::: to avoid triggering unintended divs (#11571).
  • Man writer:

  • Don’t run together successive definitions in a tight definition list with multiple definitions after a term (#11547).

  • Text.Pandoc.Writers.Shared:

    • htmlAttrs: use data- prefix when needed (#11680). This now behaves like the HTML writer, adding the data- prefix for custom attributes. This will affect, e.g., the mediawiki writer.
  • Text.Pandoc.Error:

    • Display IOError without stack trace (#11676).
    • Use single quotes around paths and format names (#11645) in displayed messages.
  • Text.Pandoc.App.Opt:

    • Opt has a new field optTypstInputs [API change].
  • Text.Pandoc.Options:

    • Change defaultMathJaxURL to use MathJax v4 (#11669).
    • ReaderOptions has a new field readerTypstInputs [API change].
  • Text.Pandoc.Citeproc.BibTeX:

    • Prevent wrong combination of subtitle and titleaddon with maintitle (#11677, Amir Dekel). When maintitle is present, subtitle should not be added to title, but only to volume-title.
    • BibLaTeX inbook should be CSL book, not chapter (#11552).
    • Allow doi field in bibtex (input and output) (#11617, Thomas Hodson).
  • Text.Pandoc.Translations:

    • Find lang-script type translations (#11648). E.g. for zh-Hant-TW look for (in order) zh-Hant-TW.yaml, zh-Hant.yaml, zh.yaml.
  • Text.Pandoc.Parsing:

    • Various small optimizations.
    • Fix bug in extractIdClass to ensure that both id and class are stripped from key/value attributes..
  • Text.Pandoc.Shared:

    • Various small optimizations.
  • ODT reference doc: demonstrate predefined styles (310327). This mirrors the demonstration content already p...

Read more

pandoc 3.9.0.2

Choose a tag to compare

@jgm jgm released this 19 Mar 13:01
I'm pleased to announce the release of pandoc 3.9.0.2,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.9.0.2

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.9.0.2

This release just fixes a bad regression in the typst template.
Click to expand changelog
  • Typst template: fix regression introduced in 3.9.0.1 (#11538).

pandoc 3.9.0.1

Choose a tag to compare

@jgm jgm released this 18 Mar 15:30
I'm pleased to announce the release of pandoc 3.9.0.1,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.9.0.1

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.9.0.1

This is a bug-fix release, with no major new features or
API changes, but lots of small improvements. See the
changelog for details.

Thanks to all who contributed, especially new contributors
Agriya Khetarpal, Peter Briggs, Sidney Mau, and λx.x.
Click to expand changelog
  • WASM GUI:

    • Don’t block everything while pandoc.wasm loads.
    • Fix bug with Unicode filenames (#11447).
    • Catch errors loading pandoc.
  • Docx reader:

    • Recognize media inside textboxes (#11053, Raymond Berger).
    • Properly handle media stored with packaged-rooted paths such as /media (#11518). This can be produced by the online version of Word. With this change, media stored at an absolute path will be stored with its original name and not given a SHA1-based name.
    • Preserve non-textbox content when unwrapping textboxes (#11510, #6893, #11412, #5394, #9633). Treat text inside a textbox containing an image as a figure caption.
  • Typst reader:

    • Handle bibliography command (#11460). If this is present, a bibliography section is added to the document and the bibliography paths are added to bibliography in the metadata. This sets things up for using --citeproc.
  • Textile reader:

    • Handle block content in cells (#11455).
  • Docx reader:

    • Support w:gridBefore table row property (#11464, Jan Tojnar).
  • LaTeX reader:

    • Support \footnotemark and \footnotetext (#11450). These commands allow separating the footnote mark from its content, useful in tables, minipages, and other contexts where \footnote cannot be used directly.
    • Support supertabular environment (#11523, bodigrim).
  • ODT Reader:

    • Fix relative linked images (#11369, Tuong Nguyen Manh).
    • Recognize Preformatted_20_Text style Jan Tojnar This is used by LibreOffice, and we will switch to that as well.
    • Add block smushing logic (Jan Tojnar).
    • Support Preformatted Text style (#4841, Jan Tojnar).
  • Markdown reader:

    • Fix bug with lists_without_preceding_blankline (#11534).
  • Typst writer:

    • Don’t add a carriage return after \ for hard break (#11446). They are not necessary. Note that they can still be included if you use --wrap=preserve and add a newline in your source document.
    • Improve handling of data: URIs in images. Instead of using an SVG with a link containing the data URI (the solution of #10460), we can now simply produce a bytes object with the requisite bytes. Typst figures out the format automatically.
    • Fix escaping of quotes (#11463).
    • Include alt attributes on images (mcanouil).
    • Properly escape . after bracketed argument (#11511).
  • Docx writer:

    • Don’t depend on extractTarget from Docx reader.
    • Fix section breaks with --top-level-division (#11482, #10578).
  • EPUB writer:

    • Add cover metadata for EPUB3 (#11479). This allows file managers to show cover thumbnails for EPUB3 files as well.
    • Update allowed values for EPUB3 metadata identifier.scheme (#11481, Pascal Wagler).
  • ODT writer:

    • Rename inline source class to match LibreOffice (#3390, Jan Tojnar). Rename the text style we use to represent Code inlines from Source_20_Text to Source_Text. This is the same name LibreOffice Writer uses so it will be recognized by the Character Styles section of the Styles menu.
    • Remove font size from inline source class (Jan Tojnar). This matches what LibreOffice Writer is doing. Also fixes literals inside headings being too small.
    • Modernize Preformatted Text & Source Text styles (Jan Tojnar). Presumably, font-family-generic and font-pitch will allow to find a replacement on systems that do not have Courier New.
  • Markdown writer:

    • Fix rendering of alerts (#11479). We only properly handled the case where the alert started with a paragraph, but it can start with a list or other block type.
    • Escape literal & that would trigger entity (#11490).
  • HTML writer:

    • For revealjs, default scrollProgress to auto (Christophe Dervieux).
  • PPTX writer:

    • Register content type for embedded fonts (#11492).
  • MediaWiki writer:

    • Use appropriate syntax for external images (#11494). Note that they will only be rendered as images if an option $wgAllowExternalImages is enabled in the MediaWiki instance.
  • ICML writer:

    • Support for image object styles (#11498, massifrg). This change allows users to style images in InDesign bysetting the object-style attribute in a pandoc Image, which is mapped to the AppliedObjectStyle attribute in the Rectangle element around an Image element in the resulting ICML.
  • JATS writer:

    • Improve representation of Divs (Albert Krewinkel). The writer now checks if the element used to represent (non-special) Divs has any <boxed-text> specific attributes. If it does, the writer keeps wrapping the Div contents in a <boxed-text>, as it did before. Otherwise, the writer falls back to the more appropriate <p> element or simply unwraps the Div if the wrapping element wouldn’t have any attributes. The new behavior gives better semantic results in most cases, as <boxed-text> should be used for text that “is outside the flow of the narrative text”, which doesn’t apply to most divs. “Special” divs, like those used to mark sections, are not affected by this change.
  • Text.Pandoc.Writers.GridTable:

    • Normalize tables (#8102). Previously, if an invalid table was passed to toTable, an array index error could be raised. Normalizing the table forces it into a shape that won’t allow this error.
  • Lua subsystem (Albert Krewinkel):

    • Add new function pandoc.types.Sources (#11441).
  • LaTeX template: properly handle keywords with commas. These need to be put in an \xmpquote{..} command. Closes #11528.

  • HTML styles template: avoid duplicate code selector. Consolidate two clauses. Closes #11484.

  • Revealjs template: fix type rendering of scroll-view options (Christophe Dervieux, #11486).

  • Typst template:

    • Use both place and block for title (Gordon Woodhull). Otherwise the title will be confined to the left column
    • Put title block in a conditional (#11529). This avoids an empty block for documents that lack metadata information. The empty block causes problems if #set page is used, as it will cause a page break.
  • Beamer template: add logooption variable (#11452, Sidney Mau).

  • Text.Pandoc.ImageSize:

    • Correctly handle percentage width, height on SVG (#11530). Previously we were getting image size of 0 when a percentage was specified for width or height on SVG. With this change, we simply ignore these percentages (becaues ImageSize doesn’t know the size of the containing element).
  • Re-add -threaded to compile options in pandoc-cli.

  • Use released djot, asciidoc, texmath, typst.

  • Allow crypton 1.1, tls 2.2, http-client-tls 0.4.

  • Require auto-update >= 0.2.6 to fix server on macOS (#11488).

  • pandoc-cli.cabal: bump base min bound to 4.18 (same as pandoc).

  • MANUAL.txt:

    • Note that JSON may be used in YAML metadata blocks (#11525).
    • Update link for ICML in manual.
    • Fix outdated OPML spec URL in MANUAL.txt (#11504, Peter Briggs).

pandoc 3.9

Choose a tag to compare

@jgm jgm released this 04 Feb 08:55
I'm pleased to announce the release of pandoc 3.9,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.9

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.9

Starting with this release, pandoc can be compiled to WASM, making it
possible to use pandoc in the browser.  A full-featured GUI interface
is provided at https://pandoc.org/app.

Defaults files may now be in either JSON or YAML, and variable
interpolation works now for the `defaults` field of a defaults file,
making it easier for defaults files to extend others.

--extract-media will now create a zip archive containing the media
(instead of a directory) if the specified path has a .zip extension.

A special class on headings can now be used to reset 'subsequent'
status for citations processed using --citeproc. This can be important
for some styles, which require that full citation information be given
for the first citation to a work in any given chapter.

The 'alerts' extension can now be used with pandoc's Markdown.

Support has been added for PDF standards and tagging via lualatex.

API changes:

- Text.Pandoc.Shared exports hasLineBreaks.
- The PandocHttpError constructor for PandocError now takes
  a Text as argument instead of HttpException.

Thanks to all who contributed, especially new contributors Albert
Lei, Anton Melnikov, Chris Callison-Burch, Jacob Larkin, Yann
Trividic, You Jiangbin, benniekiss, and har7an.
Click to expand changelog
  • Add support for compiling pandoc to WASM. (To build, make pandoc.wasm.) A stanza in cabal.project contains the necessary build modifications. We owe this almost entirely to TerrorJack, who created the original proof of context and came up with the necessary build flags and patches to some dependencies.

    pandoc.wasm has almost all the power of regular pandoc. The main limitations is that it operates in a WASM sandbox and thus cannot use HTTP to fetch resources and cannot run system commands. As a result, JSON filters cannot be used, --embed-resources works only with resources that have been explicitly provided in the WASM sandbox, and PDFs cannot be produced (since that requires running external commands). However, Lua filters can be used, as long as they do not run system commands.

    A JavaScript bridge module, wasm/pandoc.js, is provided; this handles the setup necessary to run pandoc.wasm in a browser.

    In addition, a full-featured GUI interface is provided in the wasm subdirectory. make serve from that directory and it will run locally, or visit https://pandoc.org/app. Note that once the relevant code has been downloaded by the browser, it runs entirely in the browser, and the conversions never touch a server. The GUI was developed in interaction with Claude Code. This app includes a WASM version of Typst and can produce PDF output via Typst.

  • Defaults files may now be either JSON or YAML (though a .yaml extension will still be assumed if the file has no extension). The structure of a JSON defaults file is isomorphic to that of a YAML defaults file.

  • Variable expansion now works even for the defaults field of defaults files (#8024, Jacob Larkin).

  • --extract-media will now create a zip archive containing the media (instead of a directory) if the path provided has a .zip extension.

  • Processing with --citeproc is now affected by a reset-citation-positions class on headings. When the reset-citation-positions class is added to a top-level heading, --citeproc will reset position information at that point in the document. This is needed in order to ensure that the first citation in a chapter to a work that has been cited in a previous chapter will not be in abbreviated form.

  • RST reader:

    • Fix definition lists where term ends with - (#11323). This reverts some old code giving special treatment to lines ending in hyphens; I don’t understand why it was there, because rst2html does not seem to do this.
  • HTML reader:

    • Revert an earlier change that caused style tags in the body to be ignored (#10643, #11246).
    • Parse inline style elements as RawInline (#10643, #11246).
  • Markdown reader:

    • Fix parsing of inline math ($...$) (#11311, benniekiss). Do not allow blank lines before closing $ delimiter. This brings the parser in line with the documentation.
    • Allow superscripted spans (#11409). These were being parsed as inline notes. Now we disallow an inline note followed by attributes, as this is almost certainly meant to be a span.
    • Support alerts extension for pandoc markdown (#9716). It is not enabled by default.
  • MediaWiki reader:

    • Add behavior switches support (#11354, Anton Melnikov). They add a field to metadata without producing any text.
    • Handle non-recognized tags as plain text (#11299).
    • Better handling of inline tags (#11299). <mark>, <var>, <samp>, and <kbd> now produce Code or Span elements with classes, which can be handled by multiple output formats, instead of simply being parsed as raw HTML tags.
  • RTF reader:

    • Ensure a new paragraph on \pard (#11361, Tuong Nguyen Manh). New paragraphs may start with \pard alone without an explicit paragraph break with \par preceding it.
    • Improve hyperlink parsing more (#10942, Tuong Nguyen Manh). Both the field instruction and its result may be ungrouped.
    • Fix bug where list items were incorporated into a following table (#11364).
  • ODT reader:

    • Add table row and column spans (#11366, Tuong Nguyen Manh). Parse the number-rows-spanned and number-columns-spanned attributes to create Cells for the Table.
  • DocBook reader:

    • Support “role” attribute (#11255, Yann Trividic). The role attribute is parsed and added to Pandoc AST elements, using a wrapper Div if needed.
    • Omit empty title when not required (#11422). This affects example and sidebar elements.
    • Fix adding wrong metadata (#11300, Tuong Nguyen Manh). Now keep track of the current element stack to only add metadata if inside an appropriate parent element.
  • DocBook/JATS reader:

    • Don’t export surrounding space from inline elements (#11398). Previously we would export leading and trailing space inside elements like emphasis or ulink so they appeared outside the resulting pandoc Inline (Emph or Link). This is not really motivated; DocBook and XML in general treats leading and trailing whitespace in this context as significant.
  • Docx reader:

    • Handle tables without tblGrid (#11380).
    • Look inside v:rect as well as v:shape (#11412).
  • LaTeX reader:

    • Handle more quote macros from fontspec and ngerman babel (#6120).
  • Org reader:

    • Don’t include ‘example’ class when parsing org example blocks (#11339). These are just unmarked code blocks.
  • Texinfo writer:

    • Improve handling of certain code blocks (#11312). MediaWiki, for example, will parse a code block containing formatting as a sequence of Code elements separated by LineBreaks. For this we now use a texinfo example block.
  • Typst writer:

    • Escape hyphens when needed (#11334).
  • HTML writer:

    • Include all classes on highlighted code elements (#11423). Previously, only the language class was included, and the others were dropped.
    • Slide formats: Make . . . pause work in nested blocks (#7201, #7582).
    • For revealjs, add idiomatic highlight.js support (#11420, Claude Opus 4.5). When using --syntax-highlighting=idiomatic with reveal.js output, pandoc now generates HTML compatible with reveal.js’s built-in highlight.js plugin: Code blocks use <pre><code class="language-X"> format. The template loads highlight.js CSS, JS, and RevealHighlight plugin.
  • Markdown writer:

    • Ensure that \ line breaks are used for commonmark.
    • Use setext for headers containing line breaks for commonmark (#11341).
    • Allow display math to start/end with space (#11384). This reverts to earlier < 3.7 behavior.
    • Properly handle tables with footers (#11416).
  • JATS writer:

    • Fix XML output for nested figures (#11362, Albert Krewinkel). Subfigures are now wrapped inside a <fig-group> element. Furthermore, figure content that isn’t allowed as children of <fig> elements, such as raw text, gets wrapped in <p> elements to ensure schema-conforming XML.
  • AsciiDoc writer:

    • Use doubled delims in more contexts (#11362). Also escape the # character.
    • Use a span with role for SmallCaps (#11374).
    • Export spaces inside delimited constructs like emph.
  • Docx writer:

    • Skip directory entries when building media overrides (#11379, You Jiangbin). Pandoc’s docx writer was previously adding an <Override> for /word/media/ in [Content_Types].xml when the reference doc contains media, which violates OPC rules and causes Word to report corruption.
    • Refactor the monolithic writeDocx into a number of smaller functions (Claude Opus 4.5).
    • Replace generic XML traversal with direct path navigation (Claude Opus 4.5). Instead of using Data.Generics everywhere to traverse the entire XML tree when setting language attributes, navigate directly to the known path w:docDefaults/w:rPr/w:lang. This is more efficient and removes the dependency on Data.Generics.
  • EPUB writer:

    • Don’t use footnote backlinks for EPUBv3. Here we use aside elements, which are popups, and the backlinks are not needed; in some readers they cause a redundant number to appear, since the reader adds a note number.
  • MediaWiki writer:

    • Use Doc Text instead of Text for document construction (with Claude Open 4.5). This refactors the writer to use Text.DocLayout combinators (vcat, hcat, literal, blankline, cr, chomp) for building output, following the pattern used by other text format writers (RST, Markdown, Man). This enables better control over line spa...
Read more

pandoc 3.8.3

Choose a tag to compare

@jgm jgm released this 01 Dec 10:30
I'm pleased to announce the release of pandoc 3.8.3,
available in the usual places:

Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.8.3

Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.8.3

This release adds three new input formats (asciidoc, pptx, and
xlsx) and one new output format (bbcode + variants).

It fixes a number of bugs (including some regressions in 3.8).
See the changelog for full details.

API changes:

  + New exported module Text.Pandoc.Readers.AsciiDoc,
    exporting readAsciiDoc.
  + New module Text.Pandoc.Readers.Pptx, exporting readPptx.
  + New module Text.Pandoc.Readers.Xlsx, exporting readXlsx.
  + Text.Pandoc.Readers: Export readAsciiDoc, readXlsx, readPptx.
  + New module Text.Pandoc.Writers.BBCode, exporting
    writeBBCode,  writeBBCodeSteam, writeBBCodeFluxBB,
    writeBBCodePhpBB, writeBBCodeHubzilla, writeBBCodeXenforo.
  + Text.Pandoc.Writers: Export writeBBCode,
    writeBBCodeSteam, writeBBCodeFluxBB, writeBBCodePhpBB,
    writeBBCodeHubzilla, writeBBCodeXenforo .
  + Text.Pandoc.Writers.Shared: Export insertCurrentSpansAtColumn,
    takePreviousSpansAtColumn and decrementTrailingRowSpans.
  + Text.Pandoc.Shared: Export allRowsEmpty and
    tableBodiesToRows.

Thanks to all who contributed, especially new contributors
Anton Antich, and Asliddinbek Azizovich, and James Barlow.
Click to expand changelog
  • Add asciidoc as an input format (#1456).

  • Add xlsx (Microsoft Excel) as an input format (Anton Antich). Each worksheet turns into a section containing a table.

  • Add pptx (PowerPoint) as new input format (Anton Antich).

  • Add bbcode as a new output format (#11242, reptee). Several variants of BBCode are also supported: bbcode_fluxbb (FluxBB), bbcode_phpbb (phpBB), bbcode_steam (Hubzilla), bbcode_hubzilla (Hubzilla), and bbcode_xenforo (xenForo).

  • New exported module Text.Pandoc.Readers.AsciiDoc, exporting readAsciiDoc [API change].

  • New module Text.Pandoc.Readers.Pptx, exporting readPptx (Anton Antich) [API change].

  • New module Text.Pandoc.Readers.Xlsx, exporting readXlsx (Anton Antich) [API change].

  • LaTeX reader:

    • Revert \linebreak as LineBreak (#11272). \linebreak is more of a hint, it shouldn’t produce a hard break.
    • Better handling of \makeatletter in parsing raw LaTeX (#11270).
    • Fix spurious paragraph breaks in math environments (#11265, Emmanuel Ferdman). Previously, a math environment with extra space before the \end would get rendered with a blank line, which LaTeX treats as a paragraph break.
    • Change type on rawLaTeXParser in Text.Pandoc.LaTeX.Parsing. The preparser doesn’t need to return a value.
    • Fix rawTeXParser (#11253). Make macro expansion in raw LaTeX depend on the setting of the latex_macros extension. Previously macros were always expanded, even in raw TeX in markdown. In addition, there was previously a bug that caused content to be garbled in certain cases.
    • Handle ifstrequal at a lower level, like the other if commands (#11253).
    • Move ifstrequal, iftoggle, etc., which were misplaced in environments, to blockCommands, so these commands work properly.
  • Docx reader:

    • Handle REF link instruction (#11296, Ezwal).
    • Check recursively for caption styles (Albert Krewinkel). The docx reader uses caption styles to identify figures and captioned tables. It now checks for known caption styles in the full styles hierarchy of a paragraph instead of just checking the style directly. This allows to recognize caption styles that are built on top of the basic caption style, as is sometimes the case in sophisticated styles.
  • Markdown reader:

    • Fix performance issue in links with ' (#10880).
  • Typst reader:

    • Handle document metadata and #title (jgm/typst-hs#80). Note that previously, the typst reader never returned document metadata. Now it does, even if the typst document does not contain a #title function that would result in actually printing the title block.
  • Djot reader:

    • Add Space elements (#11250). Previously we just got big Str elements with spaces included. But many pandoc writers assume that breakable spaces will be Space elements, and this is also required for automatic wrapping.
  • RST reader:

    • Correctly handle intraword emphasis (#11309).
  • Text.Pandoc.Readers:

    • Export readAsciiDoc, readXlsx, readPptx [API change].
  • New module Text.Pandoc.Writers.BBCode, exporting writeBBCode, writeBBCodeSteam, writeBBCodeFluxBB, writeBBCodePhpBB, writeBBCodeHubzilla, writeBBCodeXenforo [API change].

  • LaTeX writer:

    • Make level 1-3 headings work inside blockquotes (#11281, James Barlow).
    • Remove split from list of math environments (#11274).
    • Improve handling of math environments in tex math (#11266).
  • HTML writer:

    • Add reveal.js scroll and scrollSnap options to writer and template (#10052, Asliddinbek Azizovich).
    • Use ‘defer’ when including mathjax script, as recommended in MathJax docs (#11292).
  • ANSI writer:

    • Apply row spans in tables (#10149, Tuong Nguyen Manh). The ANSI writer is now able to keep track of row spans and apply them in rows.
  • Pptx writer:

    • Handle reference doc without slides (#7536, Tuong Nguyen Manh).
  • AsciiDoc writer:

    • Add more table features (#11267, Tuong Nguyen Manh): Row span and column span, footer row, individual horizontal cell alignment.
  • Typst template:

    • Fix font for compatibility with typst 0.14, which doesn’t permit an empty array for font (#11238).
    • Re-add columns to typst template (#11259), fixing a pandoc 3.8 regression.
    • Fix syntax for bibliography inclusion (#11233, Mickaël Canouil). Previously the syntax was wrong when multiple bibliography files were specified. Typst expects an array.
  • Text.Pandoc.Writers:

    • Export writeBBCode, writeBBCodeSteam, writeBBCodeFluxBB, writeBBCodePhpBB, writeBBCodeHubzilla, writeBBCodeXenforo [API change].
  • Text.Pandoc.Writers.Shared:

    • Add functions insertCurrentSpansAtColumn, takePreviousSpansAtColumn and decrementTrailingRowSpans for applying and keeping track of RowSpans over multiple rows (#10149, Tuong Nguyen Manh). [API change]
  • Text.Pandoc.Logging:

    • Change message for missing HTML title warning (#11307). Suggest setting the pagetitle variable instead of setting title in metadata.
  • Lua subsystem:

    • Preserve common state of custom Lua readers (Albert Krewinkel). The common state is transferred to Lua when calling a custom Lua reader, and is now also transferred back after the reader has finished. This ensures that info messages, warnings, and mediabag entries are available to the main program and all subsequent processing steps.
  • Text.Pandoc.PDF:

    • Avoid converting SVG to PDF when non-TeX PDF engine is used (#11275). This fixes a 3.8 regression, which caused documents with SVGs to raise an error when converted to PDF using WeasyPrint.
    • Fix a 3.8 regression with typst and smart quotes (#11256). Before 3.8, the default behavior when producing a PDF -t typst was to produce smart quotes according to typst’s defaults. (This could be defeated by specifying -t typst-smart.) This behavior broke in 3.8 because of a change to Text.Pandoc.PDF. This change caused smart to be disabled for all formats when producing PDFs, when before it was only disable for TeX-based formats (to avoid bad ligatures). This commit restores the old behavior. Possibly the regression also other affects other non-TeX formats, e.g. HTML.
  • Text.Pandoc.Shared:

    • Add functions allRowsEmpty and tableBodiesToRows from the RST writer for reuse in other writers. (Tuong Nguyen Manh) [API change].
  • Text.Pandoc.Citeproc:

    • Allow formatting in locator to be transmitted to citeproc. We do this indirectly, by rendering the formatting using the HTML tags that citeproc recognizes. Fixes jgm/citeproc#68 and jgm/citeproc#163. Note that formatting is only possible for locators given in the explicit form, surrounded by curly braces. It won’t work for implicit locators, since these expect number-like expressions.
  • New non-exported module Text.Pandoc.Readers.OOXML.Shared containing functions factored out from Text.Pandoc.Readers.Docx.Util (Anton Antich).

  • Tests: The common file nativeDiff has been extracted from the Docx and Pptx text files and put in Tests.Helpers.

  • Use asciidoc 0.1, djot 0.1.2.4, texmath 0.13.0.2, typst 0.8.1, citeproc 0.12.

  • MANUAL.txt:

    • Improve implicit_figure documentation (#11082).
    • Give both forms of options when referring to them (#11306).
  • Update INSTALL.md (#11271).