Commit Graph
18382 Commits
Author SHA1 Message Date
Tuong Nguyen Manh 01f97ed55d Typst Writer: Check XID_Continue in identifiers
Add unicode-data dependency for isXIDContinue for this to match the
rust implementation.
Also apply hlint suggestions for redundant $, literal pattern and
moving brackets to avoid $.
2025-08-26 18:25:08 +02:00
Sean Soon 1bee23683d Support header and footer in MAN reader 2025-08-26 18:22:16 +02:00
John MacFarlane 10404ca6d5 Add dev doclayout to stack.yaml. 2025-08-26 12:41:19 +02:00
Castedo Ellerman fce2ae101d doc page: add Baseprinter pandoc wrapper to extras 2025-08-26 12:23:36 +02:00
John MacFarlane 7e4ef3c54a Markdown reader: don't confuse a span after...
an author-in-text citation with a locator.  E.g. `@foo [test]{.bar}`.

See https://github.com/jgm/pandoc/issues/9080#issuecomment-3221689892.
2025-08-26 11:24:02 +02:00
Reuben Thomas 5e92187c88 common.latex: add RTL support for LuaTeX engine 2025-08-24 09:59:48 +02:00
John MacFarlane 4c69f288d9 Revert "Add features to typst base template."
This reverts commit f000fa168b.
2025-08-24 09:47:44 +02:00
John MacFarlane 93f8145fa4 Make -t chunkedhtml -o - output to stdout (as documented)...
rather than creating a directory called `-`.

Closes #11068.
2025-08-21 23:24:52 +02:00
dependabot[bot] 072efe81f8 Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 05:04:54 -07:00
John MacFarlane 1ac4030c1a Rename command test for 10047 -> 11047.
Commit 2c857d3 closed #11047 but was mislabeled as closing #10047.
2025-08-17 17:53:32 +02:00
John MacFarlane 5e50e4e605 Citeproc: don't move footnotes around em-dashes.
Closes #11046.
2025-08-17 17:45:36 +02:00
John MacFarlane 2c857d379b Typst writer: add escapes to prevent inadvertent lists...
due to automatic wrapping.

Also simplify existing code that was meant to do this.

Closes #10047.
2025-08-17 17:45:36 +02:00
John MacFarlane f1404e2d2f LaTeX writer: add braces around comments in title-meta.
This is needed to prevent PDFs from interpreting this as a
sequence of titles.

See #10501.
2025-08-17 17:45:36 +02:00
R. N. West e0160fbc23 MANUAL.txt: fix broken ConTeXt links
Close #11055.
2025-08-16 08:05:19 +02:00
R. N. West 42f0280854 ImageSize: Fix JPEG file signature detection.
The previous implementation didn't include all possible JPEG file
signatures. All signatures in the range of ff d8 ff e0 and ff d8 ff ef
should be valid, in addition to ff d8 ff db (no application segment).
See <https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5?permalink_comment_id=3863054#gistcomment-3863054>
and p. 32 of <https://www.w3.org/Graphics/JPEG/itu-t81.pdf>.
2025-08-15 22:27:04 -07:00
Albert Krewinkel 4b01fd700a MANUAL.txt: fix minor capitalization typo
Fixes: #11052
2025-08-15 20:05:36 +02:00
John MacFarlane bb6c58c851 ImageSize: Handle jpgs with signature FF D8 FF EE.
Closes #11049.
2025-08-14 22:13:34 -07:00
Albert Krewinkel 2234a6b08f Org reader: allow "greater block" names to contain any non-space char
Closes: #4287
2025-08-14 23:09:46 +02:00
Albert Krewinkel de31a9f130 Org reader: accept quoted values as argument values.
Fixes: #8869
2025-08-14 19:35:37 +02:00
John MacFarlane a6a5be132a Typst writer: add parens around typst-native year-only citations.
Closes #11044.
2025-08-12 22:43:27 -07:00
Albert Krewinkel a36654b222 Lua: add function pandoc.structure.unique_identifier.
The function generates element identifiers based on inlines content.
It's primary use case is the programmatic generation of ID, similar to
what the `auto_identifiers` extension provides for many formats.
2025-08-12 21:37:35 +02:00
Albert Krewinkel 68d80cc9d9 Lua: add functions pandoc.text.superscript and subscript.
The functions convert numbers and parentheses to superscript and
subscript, respectively.
2025-08-12 08:47:49 +02:00
John MacFarlane 511ddc3223 Create directory of output file if it doesn't exist.
Closes #11040.
2025-08-11 22:47:52 -07:00
Albert Krewinkel 529b6d1667 Docx writer: ensure that documents don't start with a section separator
Any leading section separator is removed from the result.

Closes: #10578
2025-08-11 18:08:53 -07:00
John MacFarlane 0bbbdbcdb6 LaTeX reader/writer: change handling of math environments.
Certain environments in LaTeX will trigger math mode and can't
occur within math mode: e.g., `align` or `equation`.  Previously
we "downshifted" these, parsing an `align` environment as a
Math element with `aligned`, and an `equation` environment as a
regular display math element.  With this shift, we put these in
Math inlines but retain the original environments.

This works because:

1) texmath handles these environments just fine,
2) and so does MathJax;
3) when writing LaTeX we detect these environments in Math elements
   and emit them verbatim instead of putting them in `$..$` or
   `$$..$$`.

Closes #9711. Closes #9296.
2025-08-11 17:40:41 -07:00
John MacFarlane 6b2f66507a Use latest dev texmath. 2025-08-11 16:05:42 -07:00
Albert Krewinkel a5312c0828 LaTeX reader: parse \minisec as unlisted level 6 headings.
Closes: #10635
2025-08-10 18:36:52 -07:00
Albert Krewinkel 550fe44f95 T.P.Writers.Shared: amend docs of lookupMeta... functions.
Add notes to the Haddock docs that certain meta values lead to empty
return values.

Closes: #10634
2025-08-10 10:53:10 +02:00
Tuong Nguyen Manh 816ca8480d ODT Reader: Add table-header-rows 2025-08-10 08:20:49 +02:00
Albert Krewinkel 282fa55421 Lua: require hslua-module-system 1.2.3
This provides List methods to the value returned by
`pandoc.system.list_directory`.

Closes: #11032
2025-08-09 20:59:11 +02:00
Sean Soon 661a0b51a4 T.P.Options: Add and export defaultWebTeXURL WebTeX URL [API change] (#11029)
This fixes the `webtex` option when used without parameter in a defaults file.
2025-08-09 20:40:59 +02:00
Albert Krewinkel 7639e800c5 Org template: add #+options lines if necessary
The default template now adds `#+options` lines if non-default settings
are used for the `smart_quotes` and `special_strings` extensions.
2025-08-06 12:54:12 -07:00
Albert Krewinkel 90afbea1db Org writer: disable smart quotes by default 2025-08-06 12:54:12 -07:00
Albert Krewinkel b24bba7a20 Add smart_quotes and special_strings extensions for Org
Org mode makes a distinction between smart parsing of quotes, and smart
parsing of special strings like `...`. The finer grained control over
these features is necessary to truthfully reproduce Emacs Org mode
behavior. Special strings are enabled by default, while smart quotes are
disabled.

The behavior of `special_string` is brought closer to the reference
implementation in that `\-` is now treated as a soft hyphen.
2025-08-06 12:54:12 -07:00
Albert Krewinkel 3a185fb5d0 LaTeX writer: set pdf-trailer-id if SOURCE_DATE_EPOCH envvar is set
The `SOURCE_DATE_EPOCH` environment variable is used to trigger
reproducible PDF compilation, i.e., PDFs that are identical down to the
byte level for repeated runs.

Closes: #6539
2025-08-06 12:48:59 -07:00
Albert Krewinkel 48e59436ec LaTeX reader and writer: add support for soft hypens
The `\-` command is parsed as a soft hyphen character; likewise, the
character is written as that command when outputting LaTeX.
2025-08-06 12:08:29 -07:00
John MacFarlane 0b140a9a98 ImageSize: Unpack compressed object streams in PDFs...
...and look inside for MediaBox information. Closes #10902.
2025-08-06 11:01:13 -07:00
n.west 96fe83ecf1 reference.docx: don't left-align table header row
See #11019. Previously, centering tables in `reference.docx` would leave
the header row left-aligned. Why the OOXML 'standard' would allow table
elements to be aligned differently from the rest of the table in the
first place is anyone's guess.
2025-08-04 15:07:58 -07:00
Joseph Reagle c1a4ae1abb Update 11013.md (#11020)
Original test had a poor/misleading title.
2025-08-04 13:05:16 -07:00
John MacFarlane f2da7933a2 Do not drop fragment/hash for local file paths.
With the previous behavior it was impossible to have an image
file containing `#` or `?`.  For the motivation for the previous
behavior, see commit 1d137fb.

Closes #11021.
2025-08-04 09:53:10 -07:00
Evan Silberman b75c537d87 Fix named entity lookup in POD reader
Translating entities by name ultimately relies on
Commonmark.Entity.lookupEntity, which de facto requires the entity name
to be followed by a semicolon. Paste a semicolon onto the end of the
entity name read from POD to look it up.

Fixes #11015
2025-08-03 22:03:12 -07:00
John MacFarlane bc3a8a663d Typst reader: handle inline-level show rules on block content.
Typst allows things like `smallcaps` to be applied to block-level
content like headings.  This produces a type mismatch in pandoc,
so before processing the output of typst-hs, we transform it,
pulling the block-level elements outside of the inline-level
elements.

Closes #11017.
2025-08-03 15:20:11 -07:00
John MacFarlane c7ec476848 Fix test for #11013. 2025-08-02 11:43:30 -07:00
John MacFarlane bb46c277ca HTML writer: Unwrap "wrapper" divs.
Some of the readers (e.g. djot) add "wrapper" divs to hold attributes
for elements that have no slot for attributes in the pandoc AST. With
this change, the HTML reader "unwraps" these wrappers so that the
attributes go on the intended elements.

Closes #11014.
2025-08-02 10:50:41 -07:00
John MacFarlane 52e28c31ed Use latest dev citeproc.
Add test for #11013. Closes #11013.
2025-08-01 15:33:50 -07:00
John MacFarlane 110ed6a5ef Text.Pandoc.PDF: avoid encoding errors when reading LaTeX logs.
Sometimes they are not all UTF-8, even in a UTF-8 locale.

Closes #10954.
2025-08-01 12:05:58 -07:00
John MacFarlane 8907b0b300 Use latest dev texmath. 2025-08-01 10:04:31 -07:00
Albert Krewinkel 75aee7a23c Lua: use proper interface functions to access the CommonState.
- The `PANDOC_STATE` is no longer a userdata object, but a table that
  behaves like the old object.

- Log messages in `PANDOC_STATE.log` are now in temporal order.
2025-08-01 10:04:14 -07:00
Albert Krewinkel 57e7d895db PandocMonad: add function runSilently [API Change]
The function runs an action in the PandocMonad, but returns all log
messages reported by that action instead of adding them to the main log.
2025-08-01 10:04:14 -07:00
John MacFarlane 8799ad87b7 Make CommonState opaque.
Text.Pandoc.Class now exports CommonState as an opaque object,
without its fields. [API change]

The internal module Text.Pandoc.Class.CommonState still exports
the fields.

Text.Pandoc.Class now exports the following new functions:
`getRequestHeaders`, `setRequestHeaders`, `getSourceURL`,
`getTrace`. [API change]
2025-08-01 10:04:14 -07:00