Repository navigation
Releases
pandoc 3.13
I'm pleased to announce the release of pandoc 3.13,
available in the usual places:
Binary packages & changelog:
https://github.com/jgm/pandoc/releases/tag/3.13
Source & API documentation:
http://hackage.haskell.org/package/pandoc-3.13
This release fixes some regressions and makes many minor
improvements. See the changelog for full details.
Behavior changes:
-
Locations of errors in default files are now reported.
-
YAML is now parsed with the yamlet library, which implements
YAML 1.2. As a result, we'll get better error messages, and:yes,no,on,off,yandnare strings, not booleans.- Duplicate keys in a mapping are an error. They were a warning.
.5,.infand.nanare numbers.
The most likely way this change will bite you is if you use
noin a boolean field. This will be interpreted as a nonempty
value, which will be treated as truthy in a template.
API changes:
- Text.Pandoc.Sharde: export
plainToParaandparaToPlain. - Text.Pandoc.Writers.Shared: export new functions
wrapColumnsand
rendereWithTemplate. - Text.Pandoc.Translations:
readTranslationsnow takes the path
of the file as argument.
Thanks to all who contributed, especially new contributors
Andrzej Rybczak, Patrick Creighton, Wleeaf, and enieuwy.
Click to expand changelog
-
Report the location of errors in defaults files (#8759, Andrzej Rybczak). An invalid value in a defaults file gave an error at the start of the file, with no indication of the field. The error now names the option and points at its value.
-
Use yamlet for YAML parsing. Pandoc parsed YAML with the yaml package, which depends on the C library libyaml. It now uses yamlet, a pure Haskell YAML 1.2 parser. Values still go through the existing aeson instances. Note these behavior changes:
yes,no,on,off,yandnare strings, not booleans, as in YAML 1.2.- YAML errors now show the file, the line and the column, with the offending line. In metadata blocks the line is the line in the document.
- Duplicate keys in a mapping are an error. They were a warning.
.5,.infand.nanare numbers.
-
Docx reader:
- Read
w:fldSimplefields (#11944, Aslak Hellesøy). - Keep grid columns that have no width (#11989, Patrick Creighton).
w:wis optional onw:gridCol, butelemToTblGridskipped the grid columns that had none. The table then had fewer columns than its rows had cells, and the extra cells were dropped. Every grid column is now kept. If any of them has no (readable) width, all columns get the default width. - Fix namespaces in notes and comments (#11991, Patrick Creighton). The contents of footnotes, endnotes and comments were read with the namespace prefixes declared in word/document.xml rather than in their own parts.
- Records the indentation of each list level and track the open list levels; an unnumbered paragraph whose left indentation matches the text indentation of an open level is treated as a continuation of that level’s current item, rather than as a block quote (cf. #9197).
- Recover from fields with a missing instruction (#11943, enieuwy). This fixes a bug that could lead to content being omitted.
- Fix regression (from 3.11) in parsing column widths (#11969). The regression caused only the first column to get assigned its alignment; every other column received default alignment. In addition, in 3.11 alignment was taken from the header row if present; this changed behavior from earlier versions, which took it from the first body row. We revert to the earlier behavior, using the header row only if there are no body rows. It’s common for the header to have different alignment than the rest.
- Keep tracked paragraph marks inside notes (#11971, Aslak Hellesøy).
- Read
-
RST reader:
- Allow inline markup and bare links after
:,/,',",<(Wleeaf). Fixes a regression since 3.2.1; these characters could no longer precede an inline markup start-string or a bare URI or email address, although the reStructuredText spec allows them. Also implement the rule that a start-character between an opening character and its closing counterpart, as in(*)or"*", does not trigger inline markup.
- Allow inline markup and bare links after
-
RTF reader:
- Fix tokenization bug (#11981). We were consuming certain symbols after
\uNNNNduring tokenization. This led to an extra character being consumed as the “fallback,” so letters went missing after encoded unicode characters.
- Fix tokenization bug (#11981). We were consuming certain symbols after
-
LaTeX reader:
- Detect macro expansion loops across
doMacroscalls (#11088).
- Detect macro expansion loops across
-
ODT reader:
- Fix start numbers with
text:continue-numbering(#9595).
- Fix start numbers with
-
Markdown writer:
- Write wide tables as grid tables instead of falling back to HTML (#11945, Aslak Hellesøy).
- Don’t drop notes in notes.
- Fix regression with code block language (#11987). We try to identify which class is a language name and emit that as the gfm style info string. If none of the classes match a recognized language, before 3.10.1 we emitted the first class; fater 3.10.1, we emit nothing. This commit reverts to the pre-3.10.1 behavior.
-
RST writer:
- Don’t drop notes in notes.
-
Haddock writer:
- Don’t drop notes in notes.
-
Docx writer:
- Fix multi-paragraph list items (#9197). Previously the docx writer gave the second and subsequent paragraphs of a list item numbering from a separate list with an invisible bullet. This looked right, but semantically these paragraphs were items of another list, which is what Word, screen readers, and pandoc’s own docx reader saw; the list was also split in three. The writer now gives these paragraphs no numbering, just an indentation that lines them up with the text of the list item (as Word’s “List Continue” styles do).
-
LaTeX writer:
- Use braces around term containing
=(#11954). This is needed for the new LaTeX list code, which is triggered by usingpdfstandard.
- Use braces around term containing
-
PowerPoint writer:
- Add
clrMapOvrto notes slides (#11935, Gaurav Vijay Jadhav). This makes them importable by Keynote. - Include
langin core document properties.
- Add
-
DocBook, JATS, TEI writers:
- Apply
writerIdentifierPrefixprefix consistently.
- Apply
-
Typst writer:
- Escape
...and-?ligatures (#11979). - Use
getLangto determine lang and region. Previously only thelangmetadata field was consulted, solangcould not be set properly using a variable.
- Escape
-
Text.Pandoc.Translations:
readTranslationsnow takes the path of the file, for error messages [API change].
-
Text.Pandoc.Writers.Shared:
- Add
wrapColumns,renderWithTemplate[API change]. These factor out code that was repeated in about 20 writers: computing the line length from writerWrapText/writerColumns, and rendering the body with or without the template.
- Add
-
Text.Pandoc.Shared:
- Export
plainToParaandparaToPlain. [API change]
- Export
-
Text.Pandoc.PDF:
- Make
--presentational-hintsdefault for weasyprint. This is necessary to get list attributes (start, ordered list type, etc.) working properly (#11976).
- Make
-
cabal.project:
- Use bundle C option for zlib by default. This allows pandoc to be built without first installing the C library zlib. Those who want to use the system zlib can still compile pandoc that way by overriding this setting in cabal.project.local, or just installing directly from Hackage.
- Default to
+httpon GHC >= 9.14 (previously done only in CI), so local builds behave the same;-f-httpstill overrides it. - Pass wasm link flags for
pandoc-cliasghc-options. cabal only passes ld-options along when it finds anldprogram on the PATH. In an environment without one (e.g.nix shellwith just the ghc-wasm-meta toolchain), the flags were silently dropped and linking pandoc.wasm failed with undefinedsetjmpand clock symbols. Use-optl- ghc-optionsinstead, which GHC passes to its linker regardless.
-
Makefile:
- Add
releasetarget. - Improve
make pandoc-templatesso it does the whole job. - Use bash as
SHELL(check-cabalusespushd,check-version-syncuses==). - Fix
$(id -u)indebpkg, which make expanded to empty. - Fix missing
echoinvalidate-docx-golden-tests{,2}. - Ensure pandoc is built before rules that run it to produce files.
- Use
git ls-filesforSOURCEFILES, not the main branch’s tree. - Drop redundant
embed_data_filesflag inquick-stack.
- Add
-
Use released citeproc 0.14.1.1, texmath 0.13.3.3, gridtables 0.1.1.1 (#9085).
-
MANUAL.txt:
- Clarify the effect of
raw_htmlin commonmark formats (#8305).
- Clarify the effect of
-
Bump bounds on crypton, crypton-x509-system, tasty-bench.
-
Add
tools/circleci-build-release.sh,tools/github-build-release.sh.
pandoc 3.12.1
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 Gaulleshould 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
readFODTto Text.Pandoc.Readers.ODT. -
Add
writeFODTto 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 asodt, including--reference-doc(which should be a zippedodt) and--link-images. -
Resolve keywords after loading a syntax definition (#11921, #11923). This fixes a 3.12 regression in
--syntax-definitionthat was due to a change in skylighting. As the skylighting changelog indicates, users must now applyresolveKeywordsafter 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 Gaulleshould 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. Previouslytask_listswould not work iffancy_listswas enabled, for anycommonmarkvariant.
- Make task lists work in
-
Markdown reader:
- Put
alertaftertip, etc. in classes (#11919). Some of the writers (gfm, docbook, asciidoc, rst) check for the admonition name as the first class, so the change puttingalertfirst 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.
- Put
-
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:dstrikewas 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
getStyleFamilylinear 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:cis 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-weightfrom 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-nameortext:chapter, the RDFa wrappertext:meta, the bibliographic wrappertext: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
readFODTfor 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:imageelement instead of guessing from magic bytes.
-
RTF reader:
- Combine UTF-16 surrogate pairs (#11920).
-
Typst reader:
-
Org reader:
- Improve performance: use a jump table to find the end of plain text runs, and dispatch on the next character in
inline.
- Improve performance: use a jump table to find the end of plain text runs, and dispatch on the next character in
-
Creole reader:
- Use jump tables to find the end of plain text runs.
- Use
takeWhile1Pinstr.
-
RST reader:
- Use
takeWhile1Pfor raw field list items.
- Use
-
Textile, Vimwiki, MediaWiki, Txt2Tags readers:
- Use jump tables to find the end of plain text runs.
-
Roff readers:
- Use
takeWhile1PforregularText.
- Use
-
Mdoc reader:
- Use
takeWhile1Pin lexer.
- Use
-
Docx writer:
- Use table style
idin thetblStyleelement (#11932). Previously we used the table stylename. 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
markedspans containing math (#11885, Samuel Huang).
- Use table style
-
OpenDocument writer:
- Use
literalinstead oftext . 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
Plainblocks.withParagraphStyleonly wrappedParain a paragraph with the requested style; aPlainfell through toblockToOpenDocumentand came out with the default style. - Render the abstract as blocks. The abstract was wrapped in a Div with
custom-styleset toAbstract, but then handed tometaToContext, 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
Pnautomatic style, even when an identical one already existed. - Look up cross-reference targets in a Map. Skip the collecting walk altogether unless
xrefs_nameorxrefs_numberis 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...
- Use
pandoc 3.12
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:
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 xmlnow 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
alertis now added to the produced Divs. - Fix stream position handling in
base64DataURI. - Cheaply reject
bareURLbefore trying uri/emailAddress. - Reset sourcepos in
parseWithString'when parsing a block quote or list item. Otherwise it can happen that by the timeparseWithString'is called, the position has already been set to the next file on the command line. Fixes an odd bug withrebase_relative_paths(#11888). rebase_relative_paths: recognize URLs with unknown schemes (#11858).- Use
takeWhile1Pin the hot inline parsersstr,code,enclosure, andmmdShortSubscript. - Reset sourcepos in
parseWithString'when parsing a block quote or list item (#11888). This ensures thatrebase_relative_pathswill see the right source file.
- Make alert keywords case-insensitive (#11836, Hendrik Erz). In addition, the class
-
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 forrefelements, not for every inline element. - Handle
highlightas 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).
- Map
-
LaTeX reader:
- Support LaTeX3 (xparse) document commands (#7540). Support the features described in the LaTeX usrguide.
- Fix
\qedto produce U+00A0 (nbsp) instead of BEL. - Fix
unescapeURLhandling of escaped backslash. - Require that
\newifnames 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
untokenizelinear instead of quadratic. - Fail
macroDeffast on non-macro-defining commands. - Peek at next token directly in
peekTokinstead of going throughsatisfyTok. - Skip
doMacrosstate 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
\iftrueetc.
-
Docx reader:
- Read ScreenTips as link titles (#11869, Robert Szarka).
- Use
comment-idinstead ofidin AST for comments.
-
ODT reader:
- Rewrite in monadic style. Net -994 lines. No changes to test output.
- Handle
textPropertieson 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_htmlfor 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/codeattribute precedence for first-wins dedup. - Implement
pSatisfyas 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
pTagContentsto trypStrandpSpacebefore 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.
- Don’t require a closing tag for checkbox inputs.
-
Muse reader:
- Try
strearlier 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.
- Try
-
Org reader:
- Fix hard parse failure on bare backslash.
- Recognize
.pdfas an image format (#11859). This matches the behavior of Emacs, which will render[[file:foo.pdf]]as an image. - Make
#+OPTIONS: ^:nildisable 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
lookupGEto 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_gfmhandling. - Avoid rebuilding the token list with
map idinsourceToToksin the common case where the source starts at line 1.
- Avoid nested walks in
-
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:
-
RST writer:
- Apply
nowrapto just footnote label, not body. This bug surfaced afternowrapwas fixed in doclayout.
- Apply
-
Docx writer:
- Fix sizing for images (#11838). Setting size to a percent now scales image to p...
pandoc 3.11
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-methodoption. This replaces (now deprecated but still functional) options--mathml,--mathjax,--gladtex,--katex,--webtex. Theplainstyle can now be specified explicitly. In defaults files,html-math-methodis nowmath-method(thoughhtml-math-methodwill still work). -
Make
mathmlthe default math-method (#11751). -
Add
--completion={bash,zsh,fish}(#8542, wzy). Make--bash-completionan 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
writerHTMLMathMethodfield of WriterOptions towriterMathMethod.
-
Markdown reader:
- Add a syntax
(1@label)for resetting example list counter (#10940). This is needed often at the beginning of a chapter.
- Add a syntax
-
MediaWiki writer:
- Put
<nowiki>around possible URLs (#11834). Otherwise they get linkified automatically.
- Put
-
Docx reader:
-
RTF Reader:
- Add support for nested tables (#11218, Alex).
-
Typst reader:
- Remove handling of ‘block’ as an inline-level element (#11814).
-
HTML reader:
- Handle
prewithoutcode(#11810). Preserve whitespace as nonbreaking spaces.
- Handle
-
ODT/OpenDocument writers:
- Support RTL text direction (#11301). RTL is now properly handled in these cases:
dir: rtl(orltr) in document metadata; an RTLlangin metadata (e.g.he,ar), unless overridden bydir; adirattribute on a Div. Code blocks remain ltr regardless. - Use
style:language-complexrather thanfo:languagefor RTL languages (#11301). - Fix treatment of DefaultHighlighting (#11829).
- Support RTL text direction (#11301). RTL is now properly handled in these cases:
-
Docx writer:
- Initialize envLang from
langmetadata (#11301). This ensures that settinglangwill affect the whole document. Previously, settinglangtohewas not sufficient to make the document RTL.
- Initialize envLang from
-
JATS writer:
- Fix illegal use of
pelement insidep(#11809).
- Fix illegal use of
-
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
optHTMLMathMethodtooptMathMethod. [API change]
- In Opt, 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 callingfetchItemingetTemplate, we temporarily reset thestSourceURLin CommonState so that the template is sought locally. Previously, an exception infetchItemwould preventstSourceURLfrom 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 casegetTemplatehandles the exception by looking for the file in the user data directory. This patch fixes the bug so that thestSourceURLis reset regardless of whetherfetchItemraises an exception. Thanks to Yingjie Su for identifying the problem.
- Fix bug in
-
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
nubwithnubOrd. -
Use latest releases of djot, asciidoc, typst, texmath.
-
MANUAL.txt:
- Add a note that
thanksin typst doesn’t currently work (#11807). - Note that sourcepos extension works for djot too.
- Add a note that
pandoc 3.10.2
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
hrelement (#11793).
- Raw HTML: fix handling of void
-
LaTeX writer:
-
Typst writer:
-
Typst template: rename
horizontalruletohorizontalRule, 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
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
.yamlextension in--defaultsoption (#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--defaultswith bash/zsh<(..)or=(..). -
RST reader:
-
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/\pntextparagraph numbering (#11686).
-
Docx reader:
-
LaTeX reader:
- Handle
\hypertargetwith one braced parameter (#7418).
- Handle
-
DokuWiki reader:
- Skip non-cell content after table row (#11739).
-
Typst reader:
-
HTML reader:
-
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:
-
LaTeX writer:
- Provide a way to use table instead of longtable (#1023). When the
floatclass is attached to a table, a standard floatingtablewill be generated instead of alongtable. Placement can be specified via thelatex-placementattribute. This will help, especially, those who use two-column layouts, sincelongtableis incompatible with these. - Fix footnotes in definition list headings (#8240).
- Provide a way to use table instead of longtable (#1023). When the
-
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-charon theirdraw: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/\ilvlreferences or the\listtable/\listoverridetablethat 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.
- 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
-
Typst writer:
- Fold
langintopickTypstAttributes(#11673). This ensures thatlangattributes 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
#blockfor the definition; this allows it to remain on the same line as the term. - Emit
divider()as horizontal rule (#11540).
- Fold
-
LaTeX template:
- The
captionpackage is included and a default spacing set between the caption and the table.
- The
-
Typst template:
- Remove custom show rule for terms. Instead, we use a set rule to set hanging-indent.
- Remove old
horizontalRuledefinition from default template. - Polyfill
dividerfor 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:
-
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).
- Improve
-
Text.Pandoc.App.CommandLineOptions:
- Use
optCSLandoptBibliographyfrom Opt (#11741). Previously we setoptMetadatadirectly, but that had some unintended effects, especially in interacting with defaults files. With this change, a--cslon the command line can override one set in a prior defaults file.
- Use
-
Text.Pandoc.App:
- Enable
auto_identifierswhen a table of contents is requested (#11041). Table-of-contents entries link to heading identifiers, so when--toc/--table-of-contentsis given, force theauto_identifiersextension on for the input format even when it is off by default (as it now is for typst). This makes typst-to-markdown--tocproduce working links.
- Enable
-
Text.Pandoc.Writers.Shared:
htmlAttrs- don’t adddata-prefix formarkdown(#11685). This is necessary for themarkdown_attributeextension 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:
pandoc 3.10
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-inputCLI option (#11588). This allows one to pass parameters to typst, which are available atsys.inputs, just astypstitself does with its--inputoption. -
Avoid trailing spaces in
--helpoutput (#11623). -
Make groff the default pdf-engine for
msoutput (#11558). Formerly it was pdfroff. -
Set default User-Agent request header to
pandoc/VERSION. This can be overridden using the--request-headeroption. -
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
tblHeaderelement (#8299). IftblHeaderexists but hasw:val="0", then don’t consider the element a header. - With
citationsextension, prefercitation-keyas the key for item data, if it is defined (#11581; cf. #10366, #11567). Theidkey used by Zotero is not exposed by their API and is generally not what is wanted when converting to biblatex. - Don’t look to
exttags 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, andascii_identifiersextensions (#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--tocto produce working anchor links. - Better handling of
.TPmacro (#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.
- Support
-
Roff reader:
- Handle
\line continuation in table cells (#11635).
- Handle
-
LaTeX reader:
-
Typst reader:
-
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 useNumbering_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 viatext:start-valueon thetext:listelement instead of a new style. - List-item paragraphs use
List_20_Bullet[_Tight]andList_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
Quotationsparagraph 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_Textdirectly. - Emphasis, Strong, Strikeout, Subscript, Superscript and Code spans use the predefined
Emphasis,Strong_20_Emphasis,Strikeout,Subscript,SuperscriptandSource_20_Texttext styles. paraStyle/paraStyleFromParentno longer emit a wrapper automatic style when its only attribute would beparent-style-name; the parent name is returned directly.
- Bullet lists use
-
-
EPUB writer:
- Support multiple EPUB versions for raw content (#11628, nibras shami). This change ensures that raw content marked
epub2will appear in (only) EPUBv2 output and content markedepub3will appear in (only) EPUBv3 output.
- Support multiple EPUB versions for raw content (#11628, nibras shami). This change ensures that raw content marked
-
Typst writer:
-
LaTeX writer:
- Fix
fr-CAbabel language mapping (#11575, Christophe Dervieux). Map fr-CA tofrenchinstead of deprecatedcanadien. The babel-french package’scanadien.ldfis deprecated and broken: it never calls\ldf@finish, so\bbl@main@languageis left undefined, causing babel to crash at\begin{document}. Sincecanadienwas always just an unconditional alias forfrench, usefrenchdirectly.
- Fix
-
MediaWiki writer:
-
Markdown writer:
-
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: usedata-prefix when needed (#11680). This now behaves like the HTML writer, adding thedata-prefix for custom attributes. This will affect, e.g., the mediawiki writer.
-
Text.Pandoc.Error:
-
Text.Pandoc.App.Opt:
- Opt has a new field
optTypstInputs[API change].
- Opt has a new field
-
Text.Pandoc.Options:
- Change
defaultMathJaxURLto use MathJax v4 (#11669). - ReaderOptions has a new field
readerTypstInputs[API change].
- Change
-
Text.Pandoc.Citeproc.BibTeX:
- Prevent wrong combination of
subtitleandtitleaddonwithmaintitle(#11677, Amir Dekel). Whenmaintitleis present,subtitleshould not be added totitle, but only tovolume-title. - BibLaTeX
inbookshould be CSLbook, notchapter(#11552). - Allow
doifield in bibtex (input and output) (#11617, Thomas Hodson).
- Prevent wrong combination of
-
Text.Pandoc.Translations:
- Find lang-script type translations (#11648). E.g. for
zh-Hant-TWlook for (in order)zh-Hant-TW.yaml,zh-Hant.yaml,zh.yaml.
- Find lang-script type translations (#11648). E.g. for
-
Text.Pandoc.Parsing:
- Various small optimizations.
- Fix bug in
extractIdClassto ensure that bothidandclassare 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...
pandoc 3.9.0.2
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
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
bibliographyin the metadata. This sets things up for using--citeproc.
- Handle bibliography command (#11460). If this is present, a bibliography section is added to the document and the bibliography paths are added to
-
Textile reader:
- Handle block content in cells (#11455).
-
Docx reader:
- Support
w:gridBeforetable row property (#11464, Jan Tojnar).
- Support
-
LaTeX reader:
-
ODT Reader:
-
Markdown reader:
- Fix bug with
lists_without_preceding_blankline(#11534).
- Fix bug with
-
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=preserveand 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
bytesobject 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).
- Don’t add a carriage return after
-
Docx writer:
-
EPUB writer:
-
ODT writer:
- Rename inline source class to match LibreOffice (#3390, Jan Tojnar). Rename the text style we use to represent
Codeinlines fromSource_20_TexttoSource_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 Textstyles (Jan Tojnar). Presumably,font-family-genericandfont-pitchwill allow to find a replacement on systems that do not haveCourier New.
- Rename inline source class to match LibreOffice (#3390, Jan Tojnar). Rename the text style we use to represent
-
Markdown writer:
-
HTML writer:
- For revealjs, default
scrollProgresstoauto(Christophe Dervieux).
- For revealjs, default
-
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
$wgAllowExternalImagesis enabled in the MediaWiki instance.
- Use appropriate syntax for external images (#11494). Note that they will only be rendered as images if an option
-
ICML writer:
- Support for image object styles (#11498, massifrg). This change allows users to style images in InDesign bysetting the
object-styleattribute in a pandoc Image, which is mapped to the AppliedObjectStyle attribute in the Rectangle element around an Image element in the resulting ICML.
- Support for image object styles (#11498, massifrg). This change allows users to style images in InDesign bysetting the
-
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.
- Improve representation of Divs (Albert Krewinkel). The writer now checks if the element used to represent (non-special) Divs has any
-
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.
- Normalize tables (#8102). Previously, if an invalid table was passed to
-
Lua subsystem (Albert Krewinkel):
- Add new function
pandoc.types.Sources(#11441).
- Add new function
-
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 pageis used, as it will cause a page break.
-
Beamer template: add
logooptionvariable (#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
-threadedto 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:
pandoc 3.9
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 incabal.projectcontains 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.wasmhas 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-resourcesworks 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 runpandoc.wasmin a browser.In addition, a full-featured GUI interface is provided in the
wasmsubdirectory.make servefrom 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
.yamlextension 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
defaultsfield of defaults files (#8024, Jacob Larkin). -
--extract-mediawill now create a zip archive containing the media (instead of a directory) if the path provided has a.zipextension. -
Processing with
--citeprocis now affected by areset-citation-positionsclass on headings. When thereset-citation-positionsclass is added to a top-level heading,--citeprocwill 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.
- Fix definition lists where term ends with
-
HTML reader:
-
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
alertsextension for pandoc markdown (#9716). It is not enabled by default.
- Fix parsing of inline math (
-
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\pardalone without an explicit paragraph break with\parpreceding 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).
- Ensure a new paragraph on
-
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
roleattribute 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.
- Support “role” attribute (#11255, Yann Trividic). The
-
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:
-
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=idiomaticwith 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:
-
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.
- Fix XML output for nested figures (#11362, Albert Krewinkel). Subfigures are now wrapped inside a
-
AsciiDoc writer:
-
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].xmlwhen the reference doc contains media, which violates OPC rules and causes Word to report corruption. - Refactor the monolithic
writeDocxinto 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
everywhereto traverse the entire XML tree when setting language attributes, navigate directly to the known pathw:docDefaults/w:rPr/w:lang. This is more efficient and removes the dependency onData.Generics.
- Skip directory entries when building media overrides (#11379, You Jiangbin). Pandoc’s docx writer was previously adding an
-
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...