Commit Graph
18953 Commits
Author SHA1 Message Date
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
Christophe Dervieux cf955e9441 LaTeX writer: fix fr-CA babel language mapping (#11576)
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.

Closes #11575.
2026-04-11 13:51:29 +02:00
John MacFarlane df29187f9e Typst reader: implement "rotate" as pass-through.
Information about the angle is encoded in an attribute
of an enclosing span or div.

Closes #11531.
2026-04-10 11:20:46 +02:00
John MacFarlaneandClaude 381b82e4a3 Docx writer: fix FirstParagraph style lost after heading with footnote.
When a heading contained a footnote, processing the footnote's block
content would consume the stFirstPara flag, causing the following
paragraph to incorrectly receive BodyText style instead of
FirstParagraph. Fix by saving and restoring stFirstPara around
footnote block processing.

Closes #11573.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 21:13:28 +00:00
John MacFarlane 748babc80f stack.yaml - don't use dev version of doclayout.
This causes problems with linking on stack.
2026-04-09 19:08:42 +02:00
John MacFarlaneandClaude 71d54870c4 Markdown reader: simplify checkNotes, remove dead code
Use M.toList to iterate over defined notes with both key and
value, instead of M.keys followed by redundant M.lookup for
each key. This also removes the unreachable Nothing branch
(a key obtained from M.keys is always present in the map).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 18:45:45 +02:00
John MacFarlaneandClaude 2f4982f36f Markdown reader: use direct predicate in wikilink
Replace 'notElem' with a per-character list scan with an inline
predicate using equality checks.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 18:32:59 +02:00
John MacFarlaneandClaude 36b18947fb Markdown reader: use direct predicate in isSmallCapsFontVariant
Replace 'notElem' with a per-character list scan with an inline
predicate using equality checks.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 18:32:59 +02:00
John MacFarlaneandClaude 6228244136 Markdown reader: use direct predicate in rawTeXBlock
Replace 'elem' with a per-character list scan with an inline
predicate using equality checks.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 18:32:59 +02:00
John MacFarlaneandClaude 676634c2f0 Markdown reader: avoid temporary Text in lhsCodeBlockBirdWith
Use T.head ln == ' ' (O(1) Char comparison) instead of
T.take 1 ln == " " (which allocates a 1-char Text). The
preceding T.null check ensures T.head is safe.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 18:32:59 +02:00
John MacFarlaneandClaude ecfa2aa9de Markdown reader: use T.pack . concat in exampleRef
Pack the concatenated String once instead of packing each
segment individually with map T.pack and then mconcat-ing
the resulting Texts.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 18:32:59 +02:00
John MacFarlaneandClaude a1c23e75ad Parsing: use Builder in inBalancedBraces, avoid unpack/pack
Replace the String-based reverse-accumulate-then-pack approach
with a Text.Lazy.Builder that appends characters as they are
parsed. A Bool flag tracks whether the previous character was a
backslash, replacing the pattern match on the reversed String
accumulator.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude 8e95b6011d Parsing: avoid full list traversal in fromParsecError
Replace 'length ls > ln' (which traverses the entire line list)
and 'ls !! (ln - 1)' (another traversal) with a single
'drop (ln - 1) ls' and pattern match. This is O(ln) instead
of O(length ls).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude 8deded4541 Parsing: use T.pack . concat in exampleNum
Pack the concatenated String once instead of packing each
segment individually with map T.pack and then mconcat-ing the
resulting Texts.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude 5d97d31a40 Parsing: use Builder in stringAnyCase, remove stringAnyCase'
Build the result via Text.Lazy.Builder instead of constructing
an intermediate String with (:) and then packing it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude 0969ee5a4d Parsing: avoid intermediate list in uriChunkBetween
Use T.singleton and Text concatenation instead of building
a Char list with [l] ++ chunk ++ [r] and packing it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude da27d0b752 Parsing: use Set.member for isEmailPunct
Replace per-character linear scan via T.any with O(log n)
Set.member lookup against a pre-computed top-level Set.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude e856c23c3c Parsing: simplify oneOfStrings' initial accumulator
Replace `TB.fromText mempty` with `mempty`; converting an empty
Text to a Builder is a no-op, and `mempty` is clearer.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude 5d8b30ce63 Fix extractIdClass: filter used || instead of &&
The filter predicate `k /= "id" || k /= "class"` is a tautology:
for any key, at least one of the two disjuncts is true, so no
key-value pairs were ever removed. Use && so that both "id" and
"class" entries are properly stripped from kvs.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 17:53:24 +02:00
John MacFarlaneandClaude 30bca6f38a Shared: avoid unpack/pack round-trip in splitTextByIndices
Replace the String-based splitAt' with a Text-native
splitAtWidth that computes the character index for a given
display width, then uses T.splitAt directly. This avoids
unpacking the entire Text to [Char] and repacking each piece.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 13:47:31 +00:00
John MacFarlaneandClaude 9151222cd1 Shared: use Set for tag matching in renderTags'
Replace linear 'elem' search with 'Set.member' lookup and
pre-compute the tag sets outside the per-tag callback.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 13:46:45 +00:00
John MacFarlaneandClaude 89fcb01a58 Shared: use short-circuiting 'any' in compactify
Replace list comprehension filters (which materialize the full
list) with 'any isPara', allowing early exit on the first match.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-09 13:46:17 +00:00