Commit Graph

19190 Commits

Author SHA1 Message Date
John MacFarlane 75982322cf Docx reader: improve handling of tables with uneven rows.
Previously if a table started with a 1-column row, only 1 column
would be included, even if other rows had more  columns.

Closes #11833.
2026-08-27 14:39:26 -07:00
John MacFarlane c96d3a63bd Use dev texmath. 2026-08-27 13:42:09 -07:00
John MacFarlane 1b50a4672b Text.Pandoc.Templates: Fix bug in getTemplate.
When calling `fetchItem` in `getTemplate`, we temporarily
reset the `stSourceURL` in CommonState so that the template
is sought locally. Previously, an exception in `fetchItem`
would prevent `stSourceURL` from 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 case `getTemplate`
handles the exception by looking for the file in the user
data directory.

This patch fixes the bug so that the `stSourceURL` is reset
regardless of whether `fetchItem` raises an exception.

Thanks to Yingjie Su for identifying the problem.
2026-08-26 20:26:23 -07:00
John MacFarlane 9260d17d21 Make mathml the default math-method.
Closes #11751.
2026-08-26 09:51:03 -07:00
John MacFarlane c73a35a2e7 Add --math-method option.
This replaces (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).

Text.Pandoc.App.Opt:

- In unexported type CompletionKind, add MathMethods.
- In Opt, change `optHTMLMathMethod` to `optMathMethod`. [API  change]

Text.Pandoc.Options:

- Rename HTMLMathMethod type to MathMethod. [API change]
- Rename `writerHTMLMathMethod` field of WriterOptions to
  `writerMathMethod`. [API change]

Text.Pandoc.App.Completion:

- Clean up code.
- Add support for `--math-method`.
2026-08-26 09:46:48 -07:00
John MacFarlane 7b866613f6 ODT/OpenDocument writers: support RTL text direction.
RTL is now properly handled in these cases:

- `dir: rtl` (or `ltr`) in document metadata
- an RTL `lang` in metadata (e.g. `he`, `ar`), unless overridden
  by `dir`
- a `dir` attribute on a Div

The OpenDocument writer tracks the active writing mode and, when it
is RTL, emits automatic paragraph styles with
`style:writing-mode="rl-tb"` derived from the usual named styles
(deduplicated per parent style).  `fo:text-align` is also used
to get the matching text alignment.

Code blocks remain ltr regardless.

Closes #11301.

With some help from Claude Fable.
2026-08-26 08:49:07 -07:00
John MacFarlane da54424b3c Fix some syntax highlighting regressions.
In 3.8, we added DefaultHighlighting as a HighlightStyle.
However, not all writers were updated to match on it, with
the result that we have lost highlighting in Ms, ConTeXt,
ODT, and OpenDocument.

(This was compounded by a bug in the change that was made
to the ConTeXt writer at the time.)

This commit fixes these things.

Closes #11829.

Co-authored by Claude Fable 5.
2026-08-26 02:58:14 +00:00
John MacFarlane 5727e10827 Markdown reader: Add a syntax for resetting example list counter.
This is needed often at the beginning of a chapter.

Closes #10940.
2026-08-24 12:07:19 -07:00
John MacFarlane 14b0ec95c8 Use dev version of typst. 2026-08-22 18:49:53 -07:00
Wrong-Code 1c81441a7a Fix upgrade detection for per-machine installations (#11827)
* Add FindRelatedProducts action to Install buttons

* Disabled the preliminary FindRelatedProducts until the install mode is set

Previously, registry records of previous versions were not being removed.
Closes #11825.
2026-08-22 18:37:17 -07:00
John MacFarlane 673814c32a ODT writer: use style:language-complex for RTL languages...
rather than fo:language.

See #11301.
2026-08-22 18:32:57 -07:00
John MacFarlane 0a9a2f2615 Avoid a deprecation warning relating to QuickCheck. 2026-08-22 11:00:45 -07:00
John MacFarlane 65e6d995f9 Docx writer: initialize envLang from lang metadata.
This ensures that setting `lang` will affect the whole document.
Previously, setting `lang` to `he` was not sufficient to make
the document RTL.

See #11301.
2026-08-22 10:26:07 -07:00
John MacFarlane 965e9e7d0d Revert "Use withNumTests and require QuickCheck >= 2.18."
This reverts commit b38743d218.
2026-08-22 09:50:06 -07:00
John MacFarlane b38743d218 Use withNumTests and require QuickCheck >= 2.18. 2026-08-21 23:27:19 -07:00
John MacFarlane 92937d23b3 Give correct instructions for adding zsh completion. 2026-08-20 14:54:30 -07:00
John MacFarlane 7601bcd6b4 Regularize punctuation in deprecatedOption warnings. 2026-08-20 14:04:53 -07:00
wzy 0ce83fb133 Add --completion={bash,zsh,fish} (#11818)
Make `--bash-completion` an alias of `--completion=bash`.

Reorganize option parsing code using a new data structure OptionSpec,
which can encode the type of completion needed by each option.

Add new unexported module Text.Pandoc.Completion.

Unexported module Text.Pandoc.CommandLineOptions: export OptionSpec.

Closes #8542.
2026-08-20 13:46:25 -07:00
John MacFarlane 3105b38470 Note that sourcepos extension works for djot too. 2026-08-20 13:39:57 -07:00
John MacFarlane 0507289fce beamer template: remove spurious extra tableofcontents.
It was outside the frame, and LaTeX seemed not to trip on it,
but it's a mistake. Closes #11819.
2026-08-18 13:49:49 -07:00
Alex 6658e94511 RTF Reader: nested table support (#11790)
Closes #11218.
2026-08-18 10:24:49 -07:00
John MacFarlane 5f37c6781b Typst reader: 'block' should also be block-level.
See 185c29b4b2 which claims that
`block` can occur in inline contexts. I can no longer confirm
this and suspect that it may have been an unintended behavior
of earlier versions of typst, now fixed.

Closes #11814.
2026-08-17 10:01:58 -07:00
John MacFarlane d354db9b04 Add a note that thanks in typst doesn't currently work.
See #11807.
2026-08-17 09:43:29 -07:00
John MacFarlane dd970030ba HTML reader: handle pre without code.
We preserve whitespace as nonbreaking spaces.

Closes #11810.
2026-08-17 09:27:38 -07:00
John MacFarlane cd77c632a8 Use dev asciidoc-hs. 2026-08-16 21:49:04 -07:00
John MacFarlane 8139d6bc1c Use dev version of djoths. 2026-08-16 16:25:00 -07:00
John MacFarlane 6107a26945 JATS writer: fix illegal use of p inside p.
Closes #11809.
2026-08-16 10:44:18 -07:00
John MacFarlane 6e1836ef11 Replace a use of nub with nubOrd. 2026-08-14 09:07:07 -07:00
John MacFarlane 210d70995b .hlint.yaml: add nub to restricted functions. 2026-08-14 09:06:56 -07:00
John MacFarlane fd98ee38b7 flake: remove straight-to-hackage workaround...
now that all-cabal-hashes is being updated again.
2026-08-14 09:02:11 -07:00
John MacFarlane 03a0a64843 Use dev version of djot. 2026-08-12 20:22:23 -07:00
John MacFarlane f2ee5dfee8 Update changelog. pandoc-cli-3.10.2 3.10.2 2026-08-12 10:33:00 -07:00
k6G52m4Dz75W 51c7b1bfc4 epub.css: add optional dark-mode (light-dark) support (#11791)
* epub.css: add optional dark-mode (light-dark) support

The default EPUB stylesheet hardcodes a single dark text color
(#1a1a1a) on top of the reading system's own background. This wraps
that color — and the <hr> rule and table borders that use it — with
CSS light-dark(), so readers supporting `color-scheme` get an
inverted dark theme.

Each light-dark() declaration is preceded by a plain #1a1a1a
fallback, so readers that do not support light-dark() simply drop
the new declaration and keep the unchanged original appearance
(graceful degradation). No change to pandoc's conversion logic.

Align dark-mode values with bundled breezedark palette
2026-08-12 10:25:15 -07:00
John MacFarlane 4f6f32a688 flake.nix: add direct Hackage dependencies.
This is currently needed because all-cabal-hashes hasn't been updated
for several days.
2026-08-12 10:03:58 -07:00
John MacFarlane 6a5c39456c Update release checklist template. 2026-08-11 14:56:22 -07:00
John MacFarlane 05fd82d686 Update AUTHORS. 2026-08-11 14:22:40 -07:00
John MacFarlane 3eea30b3d3 Tweak changelog. 2026-08-11 12:42:57 -07:00
John MacFarlane 3f7bff5984 Regenerate man pages 2026-08-11 12:41:35 -07:00
John MacFarlane f3e39c2643 Bump to 3.10.2, update changelog 2026-08-11 12:20:51 -07:00
John MacFarlane 1552249b90 Use released asciidoc, texmath 2026-08-11 12:00:37 -07:00
John MacFarlane 3acfe775e6 LaTeX writer: omit empty caption on unnumbered tables.
(Even if they have an identifier.)

Closes #11795.
2026-08-11 11:22:12 -07:00
John MacFarlane 7c35a540d1 Revert "Typst writer: fix escaping of quotes."
This reverts commit 04848401d5.

However, we retain the test for #11463, which didn't actually
need the reverted commit.

Closes #11788.
2026-08-11 09:35:17 -07:00
John MacFarlane d38c8594ae Update asciidoc reader tests.
In light of changes in asciidoc-hs.
2026-08-11 09:32:06 -07:00
John MacFarlane 28e328a996 Use dev version of asciidoc, texmath. 2026-08-11 09:11:05 -07:00
Philipp Gillé 980126823d Update Fedora link to pandoc-cli package (#11798) 2026-08-10 09:22:32 -07:00
John MacFarlane 33f0fa0767 CONTRIBUTING.md: remove suggestion to submit Lua filters.
The repository is no longer accepting submissions.
Closes #11800.
2026-08-10 09:20:21 -07:00
John MacFarlane 87bc462713 Typst writer: make writer sensitive to typst-label attribute.
If this attribute is set, the writer will output a label.
(This overrides labels based on identifiers, when identifiers
are present.)

Note that labels in typst need not be unique and may be used to
style elements using show rules.  For example, one can attach
an `excerpt` label to all Divs that are excerpts, and style this
using a show rule like `#show <excerpt>: set text(blue)`.

See discussion at #11794.
2026-08-07 10:39:33 -07:00
John MacFarlane 12a44fbb98 Markdown raw HTML: fix handling of void hr element.
Closes #11793.

Added `voidTags` to unexported module
Text.Pandoc.Readers.HTML.TagCategories.
2026-08-05 07:18:12 -07:00
John MacFarlane f401468a1e Revert "wasm: Removed an unneeded compilation option."
This reverts commit 9c20cebb6d.

Closes #11787.
2026-08-05 06:48:57 -07:00
John MacFarlane 5680817cac Revert "WASM build: disable legacy exception handling."
This reverts commit 49853607e6.

The option `-wasm-use-legacy-eh=false` does not seem to be
recognized in the version of the compiler we are now using.

Reopens #11787.
2026-08-04 06:56:10 -07:00