Commit Graph
18974 Commits
Author SHA1 Message Date
Meher Chaitanya 1ffeb856ee Add auto_identifiers support to Man Reader (#11675)
Add support for the `auto_identifiers`, `gfm_auto_identifiers`, and
`ascii_identifiers` extensions in the man reader. Section headings
parsed from .SH and .SS macros now receive auto-generated id
attributes when the extension is enabled, enabling `--toc` to
produce working anchor links.

- Add `autoIdExtensions` to default man extensions [behavior change]
- Add `HasReaderOptions`, `HasLogMessages` and `HasIdentifierList` to
  `ManState` to run `registerHeader`

Closes #8852.
2026-05-30 19:11:14 +02:00
Amir Dekel c6ba4d9040 Prevent wrong combination of subtitle and titleaddon with maintitle (#11677)
When `maintitle` is present, `subtitle` should not be added to `title`, but only
to `volume-title`.
2026-05-30 19:01:19 +02:00
John MacFarlane 3385981157 ODT reference doc: demonstrate predefined styles.
Previously data/odt/content.xml contained only "Hello World!", so the
reference.odt produced by `--print-default-data-file reference.odt` gave
users no visual indication of which styles pandoc uses or how their
customizations would render.

Populate content.xml with example content exercising the predefined
paragraph and text styles shipped in data/odt/styles.xml: Author, Date,
Abstract, Heading_20_1..6, First_20_paragraph, Text_20_body (with
Emphasis, Strong_20_Emphasis, Strikeout, Superscript, Subscript,
Source_20_Text, Highlighted, hyperlink, and footnote), Quotations,
Preformatted_20_Text, List_20_Bullet, List_20_Number, TableCaption,
a two-column table using Table_20_Heading and Table_20_Contents,
FigureCaption, Definition_20_Term, and Definition_20_Definition.

This mirrors the demonstration content already present in
data/docx/word/document.xml.

Closes #10327.
2026-05-29 11:17:16 +02:00
John MacFarlane 864682663e Use dev pandoc-types. 2026-05-29 09:35:56 +02:00
John MacFarlane ad4bf9aa31 Accept aeson 2.3. 2026-05-29 09:34:48 +02:00
Johan Larsson 41f829c43d Markdown reader: allow grid tables to be indented. (#11671)
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.

The leading indentation is stripped uniformly from each line before the
table is parsed, so an indented grid table produces the same AST as its
non-indented equivalent.

Adds a command test.
2026-05-28 00:07:29 +02:00
John MacFarlane 1c7cfb2a2a OpenDocument/ODT writer: use predefined styles. (#11672)
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 produced
large ODT files, made `--reference-doc` customization ineffective (the
user's predefined styles were never referenced), and gave each list its
own indentation independent of any containing block quote.

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.

Closes #9136.
Closes #5086.
Closes #2747.
Closes #3426.
Closes #7336.

Co-authored by: Claude Opus 4.7.
2026-05-27 17:35:39 +02:00
John MacFarlane 9c83002851 Use MathJax v4 in default HTML templates.
See #11669.
2026-05-26 22:44:17 +02:00
John MacFarlane d37f306299 Man reader: better handling of .TP macro.
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.

Closes #11668.
2026-05-26 12:57:29 +02:00
Sai Asish Y 8922be0530 Docx writer: fix empty keywords in core document properties (#11666)
`stringify` returns the empty string for a MetaString, so each keyword
in the `cp:keywords` list of `docProps/core.xml` was rendered as empty.
Convert each metadata value like `lookupMetaString` does instead.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
2026-05-25 15:16:18 +02:00
John MacFarlane 8886720de5 Fix cabal.project, stack.yaml (specify subdir). 2026-05-25 12:39:55 +02:00
John MacFarlane b741220c89 Use latest dev commonmark-hs. 2026-05-25 12:27:26 +02:00
John MacFarlane 646eeb6614 gridTable: fix calculation of column widths for default columns.
This fixes a bug which produced too-narrow columns in some cases.

Closes #11664.
2026-05-23 18:09:46 +02:00
nibras shami 0640c4c985 EPUB writer: support multiple EPUB versions for raw content (#11628).
This change ensures that raw content marked `epub2` will appear in (only) EPUBv2 output
and content marked `epub3` will appear in (only) EPUBv3 output.
2026-05-17 11:02:34 +02:00
John MacFarlane a263eac360 Typst writer: add zero-width space before a Span label...
...if otherwise the label doesn't come after anything.
(In this case typst will raise an error.)

Closes #11568.
2026-05-15 15:25:14 +02:00
John MacFarlane 05b0f4a4a2 Use latest citeproc. 2026-05-14 15:30:32 +02:00
John MacFarlane 73a48d2670 HTML reader: parse aside as a Div.
(Instead of using raw HTML.)

The "aside" class is added to the Div.
Also, add "header" class to Divs created from headers.

See #11626.
2026-05-14 11:58:19 +02:00
John MacFarlane 7469bd8ad2 MANUAL: improve description of reference links.
See #11643.
2026-05-13 17:29:12 +02:00
John MacFarlane b43762cdc4 Error messages: use single quotes around paths and format names.
Closes #11645.
2026-05-13 17:15:34 +02:00
John MacFarlane 4e3707543b Docx reader: fix bug in bitmask checking.
This led to some table rows being wrongly considered header rows.

We now correctly handle the example from
https://github.com/jgm/pandoc/issues/8299#issuecomment-4397472060

See #8299.
2026-05-12 15:33:45 +02:00
John MacFarlane b754d4da68 Docx reader: improve treatment of tblHeader element.
If tblHeader exists but has `w:val="0"`, then don't consider
the element a header.

See #8299...but this change doesn't seem to fix things completely.
2026-05-12 14:59:31 +02:00
John MacFarlane 93c78e4cf6 Translations: find lang-script type translations.
E.g. for zh-Hant-TW look for (in order) zh-Hant-TW.yaml,
zh-Hant.yaml, zh.yaml.

Closes #11648.
2026-05-12 14:50:59 +02:00
John MacFarlane b8a0e5e85d Roff reader: handle \ line continuation in table cells.
Closes #11635.
2026-05-11 12:30:20 +02:00
John MacFarlane 408b177bba Add NAME heading to pandoc-lua, pandoc-server man pages.
Closes #11634.
2026-05-11 12:29:45 +02:00
John MacFarlane 12051ec38a Avoid trailing spaces in --help output.
Closes #11623.
2026-05-07 12:39:06 +02:00
John MacFarlane 859f62685a HTML templates: include pandoc-version in generator meta tag.
Closes #11624.
2026-05-07 12:39:06 +02:00
Thomas Hodgson 5713ae7f11 Allow doi field in bibtex (input and output) (#11620)
Like `url`, this is not an official field, but it is supported by some styles,
including those used by natbib.sty.

Closes #11617.
2026-05-07 12:38:06 +02:00
John MacFarlane 7825bd001c Markdown reader: don't produce empty Raw element with --strip-comments.
Closes #11625.
2026-05-07 12:10:23 +02:00
積丹尼 Dan Jacobson a67492e1e0 Fix typo in MANUAL.txt regarding author variable (#11619) 2026-05-06 18:29:06 +02:00
Andrew Dunning 8e6aecfebc Markdown reader: fix quotes in inline notes (#11614)
When parsing an inline note (`^[...]`) inside a quoted span,
`stateQuoteContext` was still set to `InSingleQuote`/`InDoubleQuote`,
so quotes within notes failed to parse as `Quoted` nodes.
Fix this by wrapping the note body parser in
`withQuoteContext NoQuote`.

Closes #11613.
2026-05-04 12:56:56 +02:00
John MacFarlane 45c31661b2 LaTeX reader: evaluate theorem name when used...
rather than evaluating it when the `\newtheorem` command
is encountered. It may include macros only defined later.
Closes #11608.
2026-05-02 13:07:00 +02:00
Keenan Brock 2b5600fd0c HTML styles: make screen-only CSS conditional (#11606)
Styles unconditionally emits css that uses screen-only properties.
Paged-media engines (weasyprint, prince, pagedjs) have no viewport
and issue warnings. Fix it to hide these properties from the engines.

Closes #11524.
2026-05-02 12:43:40 +02:00
John MacFarlane 672e745839 LaTeX reader: put identifier from label on table attributes...
rather than adding an enclosing Div.

Closes #11604.
2026-05-01 00:15:40 +02:00
John MacFarlane 933b992d5b stack.yaml - don't use git version of doclayout. 2026-04-24 20:34:57 +02:00
John MacFarlane 91b1a4c791 stack.yaml - fix syntax. 2026-04-24 14:51:02 +02:00
John MacFarlane 454fe0b057 Use latest dev typst-symbols, texmath, typst-hs. 2026-04-24 13:29:41 +02:00
John MacFarlane f74179a5d8 Typst reader: Fix issue parsing figure inside rotate or box.
Closes #11598.
2026-04-24 10:55:52 +02:00
Albert Krewinkel 62ac67cff4 Lua: Add constructor pandoc.TableBody 2026-04-23 15:19:56 +02:00
Albert Krewinkel e38494be9a doc/lua-filters.md: Re-indent definition list items
This is due to the changes in commit 8ce63ffe2.
2026-04-23 15:19:50 +02:00
Olivier Benz ebb0e499b4 linux/make_artifacts.sh: add loong64 support (#11597) 2026-04-22 23:39:40 +02:00
John MacFarlane c15e062867 Markdown reader: allow spaces inside attributes in super/sub.
Closes #11589.
2026-04-18 23:19:15 +02:00
John MacFarlane a206e83e82 MANUAL: move --sandbox to general options. 2026-04-18 13:19:44 +02:00
John MacFarlane aa571d2c41 Add --typst-input CLI option.
This allows one to pass parameters to typst, which are available
at `sys.inputs`, just as `typst` itself does with its `--input`
option.

[API changes]

* ReaderOptions has a new field `readerTypstInputs`.
* Opt has a new field `optTypstInputs`.

Closes #11588.
2026-04-18 13:05:35 +02:00
John MacFarlane d9838eba11 Use latest typst-hs. 2026-04-16 12:04:51 +02:00
John MacFarlane 5ee0c74f5c wasm/index.js: include filter to embed images for pdf-via-typst.
Auto-inject embed_images filter for PDF via Typst. Otherwise
conversion fails because we can't write the images in a temporary
directory in the WASM sandbox. See jgm/pandoc#11584.
2026-04-16 11:38:54 +02:00
John MacFarlane 7d834027d1 Improve wasm Makefile.
It should rebuild js and html when SHA1s change.
2026-04-16 11:26:50 +02:00
John MacFarlane 38a23550bb Typst writer: newline after #set text directive.
This ensures that blocks such as lists are parsed correctly
after a `set text`.

Closes #11583.
2026-04-15 22:25:11 +02:00
John MacFarlane 5caad90fc4 Docx reader with citations extension: prefer citation-key...
...as the key for item data, if it is defined. The `id` key used
by Zotero is not exposed by their API and is generally not what
is wanted when converting to biblatex.

Closes #11581. Cf. #10366, #11567.
2026-04-13 12:49:03 +02:00
John MacFarlane 3fc374908c Docx reader: don't look to ext tags for image extent.
This was added in 7ff1b798c4
but was mistaken and could cause images to be parsed with
the wrong sizes.

Closes  #11580.
2026-04-13 12:04:02 +02:00
John MacFarlane f3c3cf77f0 Consolidate separate docx reader clauses in 3.9.0.1 chaneglog. 2026-04-13 10:53:09 +02:00