Click to expand changelog
-
With
--bibliography
(orbibliography
in metadata), a URL may now be provided, and pandoc will fetch the resource. In addition, if a file path is provided and it is not found relative to the working directory, the resource path will be searched (#6940). -
Add
sourcepos
extension forcommonmark
,gfm
,commonmark_x
(#4565). With thesourcepos
extension set set,data-pos
attributes are added to the AST by the commonmark reader. No other readers are affected. Thedata-pos
attributes are put on elements that accept attributes; for other elements, an enlosing Div or Span is added to hold the attributes. -
Change extensions for
commonmark_x
: replaceauto_identifiers
withgfm_auto_identifiers
(#6863).commonmark_x
never actually supportedauto_identifiers
(it didn’t do anything), because the underlying library implements gfm-style identifiers only. Attempts to add theauto_identifiers
extension tocommonmark
will now fail with an error. -
HTML reader:
- Split module into several submodules (Albert Krewinkel). Reducing module size should reduce memory use during compilation.
- Support advanced table features (Albert Krewinkel): block level content in captions, row and colspans, body headers, row head columns, footers, attributes.
- Disable round-trip testing for tables. Information for cell alignment in a column is not preserved during round-trips (Albert Krewinkel).
- Allow finer grained options for tag omission (Albert Krewinkel).
- Simplify list attribute handling (Albert Krewinkel).
- Pay attention to
lang
attributes on body element (#6938). These (as well aslang
attributes on the html element) should update lang in metadata. - Retain attribute prefixes and avoid duplicates (#6938). Previously we stripped attribute prefixes, reading
xml:lang
aslang
for example. This resulted in two duplicatelang
attributes whenxml:lang
andlang
were both used. This commit causes the prefixes to be retained, and also avoids invald duplicate attributes.
-
Commonmark reader:
- Refactor
specFor
. - Set input name to
""
to avoid clutter in sourcepos output.
- Refactor
-
Org reader:
- Parse
#+LANGUAGE
intolang
metadata field (#6845, Albert Krewinkel). - Preserve targets of spurious links (#6916, Albert Krewinkel). Links with (internal) targets that the reader doesn’t know about are converted into emphasized text. Information on the link target is now preserved by wrapping the text in a Span of class
spurious-link
, with an attributetarget
set to the link’s original target. This allows to recover and fix broken or unknown links with filters.
- Parse
-
DocBook reader:
- Table text width support (#6791, Nils Carlson). Table width in relation to text width is not natively supported by docbook but is by the docbook
fo
stylesheets through an XML processing instruction,<?dbfo table-width="50%"?>
.
- Table text width support (#6791, Nils Carlson). Table width in relation to text width is not natively supported by docbook but is by the docbook
-
LaTeX reader:
- Improve parsing of command options (#6869, #6873). In cases where we run into trouble parsing inlines til the closing
]
, e.g. quotes, we return a plain string with the option contents. Previously we mistakenly included the brackets in this string. - Preserve center environment (#6852, Igor Pashev). The contents of the
center
environment are put in aDiv
with classcenter
. - Don’t parse
\rule
with width 0 as horizontal rule. These are sometimes used as spacers in LaTeX. - Don’t apply theorem default styling to a figure inside (#6925). If we put an image in italics, then when rendering to Markdown we no longer get an implicit figure.
- Improve parsing of command options (#6869, #6873). In cases where we run into trouble parsing inlines til the closing
-
Dokuwiki reader:
- Handle unknown interwiki links better (#6932). DokuWiki lets the user define his own Interwiki links. Previously pandoc reacted to these by emitting a google search link, which is not helpful. Instead, we now just emit the full URL including the wikilink prefix, e.g.
faquk>FAQ-mathml
. This at least gives users the ability to modify the links using filters.
- Handle unknown interwiki links better (#6932). DokuWiki lets the user define his own Interwiki links. Previously pandoc reacted to these by emitting a google search link, which is not helpful. Instead, we now just emit the full URL including the wikilink prefix, e.g.
-
Markdown writer:
-
RST writer:
- Better image handling (#6948). An image alone in its paragraph (but not a figure) is now rendered as an independent image, with an
alt
attribute if a description is supplied. An inline image that is not alone in its paragraph will be rendered, as before, using a substitution. Such an image cannot have a “center”, “left”, or “right” alignment, so the classesalign-center
,align-left
, oralign-right
are ignored. However,align-top
,align-middle
,align-bottom
will generate a correspondingalign
attribute.
- Better image handling (#6948). An image alone in its paragraph (but not a figure) is now rendered as an independent image, with an
-
Docx writer:
- Keep raw openxml strings verbatim (#6933, Albert Krewinkel).
- Use Content instead of Element. This allows us to inject raw OpenXML into the document without reparsing it into an Element, which is necessary if you want to inject an open tag or close tag.
- Fix bullets/lists indentation, so that the first level is slightly indented to the right instead of right on the margin (cholonam).
- Support bold and italic in “complex script” (#6911). Previously bold and italics didn’t work properly in LTR text. This commit causes the w:bCs and w:iCs attributes to be used, in addition to w:b and w:i, for bold and italics respectively.
-
ICML writer:
- Fix image bounding box for custom widths/heighta (Mauro Bieg, #6936).
-
LaTeX writer:
- Improve table spacing (#6842, #6860). Remove the
\strut
that was added at the end of minipage environments in cells. Replace\tabularnewline
with\\ \addlinespace
. - Improve calculation of column spacing (#6883).
- Extract table handling into separate module (Albert Krewinkel).
- Fix bug with nested
csl-
display Spans (#6921). - Improve longtable output (#6883). Don’t create minipages for regular paragraphs. Put width and alignment information in the longtable column descriptors.
- Improve table spacing (#6842, #6860). Remove the
-
OpenDocument writer:
- Support for table width as a percentage of text width (#6792, Nils Carson).
- Implement Div and Span ident support (#6755, Nils Carson). Spans and Divs containing an ident in the Attr will become bookmarks or sections with idents in OpenDocument format.
- Add two extensions,
xrefs_name
andxrefs_number
(#6774, Nils Carlson). Links to headings, figures and tables inside the document are substituted with cross-references that will use the name or caption of the referenced item forxrefs_name
or the number forxrefs_number
. For thexrefs_number
to be useful heading numbers must be enabled in the generated document and table and figure captions must be enabled using for example thenative_numbering
extension. In order for numbers and reference text to be updated the generated document must be refreshed.
-
JATS writer:
- Support advanced table features (Albert Krewinkel).
- Support author affiliations (#6687, Albert Krewinkel).
-
Docbook writer:
- Use correct id attribute consistently (Jan Tojnar). DocBook5 should always use
xml:id
instead ofid
. - Handle admonition titles better (Jan Tojnar). Docbook reader produces a
Div
withtitle
class for<title>
element within an “admonition” element. Markdown writer then turns this into a fenced div withtitle
class attribute. Since fenced divs are block elements, their content is recognized as a paragraph by the Markdown reader. This is an issue for Docbook writer because it would produce an invalid DocBook document from such AST – the<title>
element can only contain “inline” elements. Handle this special case separately by unwrapping the paragraph before creating the<title>
element. - Add XML namespaces to top-level elements (#6923, Jan Tojnar). Previously, we only added
xmlns
attributes to chapter elements, even when running with--top-level-division=section
. These namespaces are now added to part and section elements too, when they are the selected top-level divisions. We do not need to add namespaces to documents produced with--standalone
flag, since those will already have xmlns attribute on the root element in the template.
- Use correct id attribute consistently (Jan Tojnar). DocBook5 should always use
-
HTML writer:
- Fix handling of nested
csl-
display spans (#6921). Previously inner Spans used to represent CSL display attributes were not rendered as div tags as intended.
- Fix handling of nested
-
EPUB writer:
-
EPUB templates: use preserveAspectRatio=“xMidYMid” for cover image (#6895, Shin Sang-jae). This change affects both the epub2 and the epub3 templates. It avoids distortion of the cover image by requiring that the aspect ratio be preserved.
-
LaTeX template:
- Include
csquotes
package ifcsquotes
variable set. - Put back
amssymb
. We need it for checkboxes in todo lists, and maybe for other things. In this location it seems compatible with the cases that prompted #6469 and PR #6762. - Disable language-specific shorthands in babel (#6817, #6887). Babel defines “shorthands” for some languages, and these can produce unexpected results. For example, in Spanish,
1.22
gets rendered as122
, andet~al.
asetal
. One would think that babel’sshorthands=off
option (which we were using) would disable these, but it doesn’t. So we removeshorthands=off
and add some code that redefines the shorthands macro. Eventually this will be fixed in babel, I hope, and we can revert to something simpler.
- Include
-
JATS template: allow array of persistent institute ids in
pid
(Albert Krewinkel). -
Text.Pandoc.Parsing: minor code and efficiency improvements.
-
Text.Pandoc.Extension:
- Add
Ext_sourcepos
constructor forExtension
[API change]. - Add
Ext_xrefs_name
andExt_xrefs_number
constructors forExtension
(Nils Carson) [API change].
- Add
-
Text.Pandoc.Citeproc:
- Fix truncation of
[Citation]
list inCite
inside footnotes (#6890). This affected author-in-text citations in footnotes. It didn’t cause problems for the printed output, but for filters that expected the citation id and other information. - Allow the use of both inline and external references (#6951), as with pandoc-citeproc. References defined in the document’s metadata take priority over references with the same id defined in an external bibliography.
- Use
fetchItem
to get external bibliography (#6940). - Ensure that BCP47 lang codes can be used. We ignore the variants and just use the base lang code and country code when passing off to citeproc.
- Citeproc BibTeX parser: revert change in
getRawField
which was made (for reasons forgotten) when transferring this code from pandoc-citeproc. The change led to--
in URLs being interpreted as en-dashes, which is unwanted (#6874).
- Fix truncation of
-
Text.Pandoc.ImageSize:
- Default to DPI 72 if the format specifies DPI of 0 (#6880). This shouldn’t happen, in general, but it can happen with JPEGs that don’t conform to the spec. Having a DPI of 0 will blow up size calculations (division by 0).
- ImageSize: use JuicyPixels to determine size for png, jpeg, and gif, instead of doing our own binary parsing (#6936). This gives more reliable results.
-
Text.Pandoc.CSS:
- Remove
foldOrElse
(internal module) (Albert Krewinkel).
- Remove
-
Use skylighting 0.10.2 (#6625).
-
Use citeproc 0.3. This fixes issues with references with duplicate ids (jgm/citeproc#36).
-
Use doctemplates 0.9. This fixes issues with boolean metadata values in the Markdown writer (#6388) and in
meta-json
(#6650). It also fixes issues with nested for loops in templates. -
Add translations zh-Hans.yaml and zh-Hant.yaml (#6904, #6909, Kolen Cheung, taotieren).
-
Add tests: True to cabal.project. This fixes some CI failures for cabal.
-
Normalize test/tables/*.native (#6888, Kolen Cheung).
-
Move executable to
app
directory to avoid problems with cabal repl. -
CONTRIBUTING: add section “How can I help?” (#6892, Albert Krewinkel). Also adds a paragraph aimed at highlighting the importance of feature maintenance.
-
MANUAL: Document that –number-sections works in
ms
(#6935).