Commit Graph
18340 Commits
Author SHA1 Message Date
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
John MacFarlane c77476b597 Improve org-cite parsing.
Handle global prefix and suffix properly.

Use all and only the styles mentioned in oc-basic.el.
2025-07-31 18:54:03 -07:00
John MacFarlane ce9583840d Improve org citation parsing (allow space after ;). 2025-07-31 15:33:20 -07:00
John MacFarlane 3e5babbb43 Fix mistaken attempt to fix #11006.
Update the test so it reflects the right output, and fix the
solution.

Really closes #11006.
2025-07-30 12:49:18 -07:00
Albert Krewinkel 6dae03f719 Typst writer: add native Typst support for nocite.
The `nocite` metadata field can now be used to supply additional
citations that don't appear in the text, just as with citeproc and
LaTeX's bibtex and natbib.

Closes: #10680
2025-07-30 11:59:41 +02:00
John MacFarlane 4066a9d483 Asciidoc writer: handle lists with sublists following continuations.
These require an additional blank line in some cases.
Closes #11006.
2025-07-29 18:37:07 -07:00
John MacFarlane f5262d88e4 TikiWiki reader: Use getVerbosity instead of getCommonState. 2025-07-29 17:24:19 -07:00
R. N. West (Nat) 9d56205784 docs: Don't encourage returning tables of filters from Lua filters (#11000)
See #10995. Use the `Pandoc:walk` method instead.
2025-07-29 16:16:38 -07:00
Albert Krewinkel de7f732be8 HTML styles: prefix default styles with informative CSS comment (#11002)
Closes #8819
2025-07-29 14:28:08 -07:00
John MacFarlane e4b6196636 LaTeX writer: be more conservative about using \url.
We only use it when the URL is all ASCII, since the `\url` macro
causes problems when used with some non-ASCII characters.

Closes #8802.
2025-07-29 14:25:23 -07:00
John MacFarlane ce6ef5cad0 ImageSize: Add Point and Pica as constructors of ImageSize.
[API change]

This will prevent unnecessary conversion of units.

Closes #8957.
2025-07-29 10:30:44 -07:00
John MacFarlane 39a2fd4308 Text.Pandoc.Class: Add stManager to CommonState.
[API change]

This allows us to cache the HTTP client manager and reuse it for
many requests, instead of creating it again (an expensive
operation) for each request.  (The documentation for `newManager`
advises sharing a single manager between requests.)

This fixes a memory leak and performance issue in files with
a large number of remote images.  Closes #10997.
2025-07-28 23:17:50 -07:00
Carlos Scheidegger 6893b38a6e Markdown writer: use fenced divs even with empty attributes.
Previously fenced divs were not used in this case, causing the writer to fall back to raw HTML.

Closes #10955.
2025-07-27 11:27:41 -07:00
John MacFarlane bfbf67ca5d Org writer: don't wrap link descriptions.
Org doesn't reliable display these as links if they have hard breaks.

Closes #9000.
2025-07-27 11:17:06 -07:00
John MacFarlane 8735bc03d8 Docx reader: fix stringToInteger.
It previously converted things like `11ccc` to an integer;
now it requires that the whole string be parsable as an integer.

Closes #9184.
2025-07-27 10:43:46 -07:00
John MacFarlane caa2193912 Ensure that the default template for xml is null. 2025-07-26 22:45:11 -07:00
John MacFarlane 9b06dc0075 MANUAL.txt: add xml as input/output format. 2025-07-26 22:45:11 -07:00
John MacFarlane 8f6eed7c72 Associate the .xml extension with the XML reader and writer. 2025-07-26 22:45:11 -07:00
massifrg fe3684632b New xml format exactly representing a Pandoc AST.
This adds a reader and writer for an XML format equivalent to `native`
and `json`.

XML schemas for validation can be found in `tools/pandoc-xml.*`.

The format is documented in `doc/xml.md`.

API changes:

- Add module Text.Pandoc.Readers.XML, exporting `readXML`.
- Add module Text.Pandoc.Writers.XML, exporting `writeXML`.

A new unexported module Text.Pandoc.XMLFormat is also added.
2025-07-26 22:45:11 -07:00
Albert Krewinkel cf11339c1d PDF: Improve error readability when pdf-engine is not supported.
Each supported engine is now printed on a line of its own.
2025-07-25 08:22:25 +02:00
Albert Krewinkel 3dfb25bb6c PDF: allow pdflatex-dev and lualatex-dev as PDF engines
These are the development versions of the LaTeX binaries; installable,
e.g., with `tlmgr install latex-base-dev`.

Closes: #10991
2025-07-25 08:19:27 +02:00
Albert Krewinkel 37b446a54c T.P.PDF: clean up makePDF 2025-07-25 07:53:57 +02:00
John MacFarlane 270fbd54f8 Use latest dev citeproc.
This solves the problem of unwanted capitalization of names
at the beginning of citations in footnotes.

Closes #10983.
2025-07-24 14:51:11 -07:00
John MacFarlane 912f4c7977 Revert a test case that changed due to a reverted citeproc change. 2025-07-24 14:51:11 -07:00
Sean Soon 937e20da0e DocBook reader: Add rowspan support. (#10981) 2025-07-24 23:07:50 +02:00
Ryan Gibb b84fa66fcb Org reader: Recognize "fast access" characters in TODO state definitions (#10990) 2025-07-24 22:40:08 +02:00
Christopher Kenny f000fa168b Add features to typst base template.
This implements the changes suggested in #9956, with the exception of
the filecolor/urlcolor one. These would require adding some regex to
guess the link types. This is theoretically possible to do, but it
wasn't clear to me that this is a good thing to put in a default
template. Happy to adjust if you have thoughts on this.

Closes #9956.

Some things to note:

I'm converting colors by passing them as content, as I was seeing pandoc
escape # if that was included.

I set the default fonts for math and code ("raw") to fonts that are
bundled with Typst. These need not be those fonts if there are more
familiar pandoc preferences.
2025-07-24 10:45:28 -07:00
John MacFarlane ebf41dd539 Fix stack.yaml. 2025-07-23 23:32:48 -07:00
John MacFarlane a4872aa223 Use dev texmath. 2025-07-23 18:46:12 -07:00
John MacFarlane 00e02e110b Use latest dev citeproc. 2025-07-23 16:08:34 -07:00
John MacFarlane 521bbb2e0c Fix CI again. 2025-07-23 16:07:09 -07:00
John MacFarlane 84bda29902 CI: another stab at preventing ghc 9.10, 9.12 from erroring. 2025-07-23 15:25:15 -07:00
John MacFarlane 54aef76773 CI: don't warn on unused imports in ghc 9.10+.
For now I want to avoid having to put in lots of CPP.
2025-07-23 15:20:34 -07:00
John MacFarlane 1778cc29a6 Ensure that all modules have explicit export lists. 2025-07-23 14:20:01 -07:00
John MacFarlane fb28952bec Revise Makefile and CI treatment of --ghc-options.
Previously we set `--ghc-options` in Makefile and CI; but this
overrides the ghc-options set in the pandoc.cabal file.

Better to add options one-by-one using `--ghc-option`.

We no longer use GHC_OPTIONS and just put these extra options
in CABAL_OPTIONS.
2025-07-23 14:10:43 -07:00
John MacFarlane 7ec7efeee7 Use latest dev citeproc.
Closes #10983 by allowing `nocase` spans to be used to suppress
capitalization of initial word in a footnote.
2025-07-23 14:10:43 -07:00
Albert Krewinkel 01a305af58 Lua: add function pandoc.path.exists.
The functions allows to check the existence of file-system objects.
2025-07-23 19:31:03 +02:00
John MacFarlane b683726447 Makefile: add -Wall to ghc options. 2025-07-23 09:09:50 -07:00
John MacFarlane 655ad77de1 Fix CI so that -Wall -Werror works again!
We were only getting the return status for the tests, apparently,
from `cabal test`. So now we run `cabal build` separately.
2025-07-23 08:54:52 -07:00
John MacFarlane b84ab366e6 Fix incomplete pattern matches from new ImageType constructor. 2025-07-23 08:51:49 -07:00
John MacFarlane ad1a7b69c7 T.P.ImageSize: support avif images.
[API change] New Avif constructor on ImageType.

Closes #10979.
2025-07-22 22:54:22 -07:00
John MacFarlane edd48fceb1 Djot writer: fix duplicate attributes before section headings.
Closes #10984.
2025-07-22 20:44:19 -07:00
Albert Krewinkel a45878ff1e Markdown writer: match indents in definition items
Previously, the first line of a definition details item always used a
colon and three spaces instead of respecting the tab-stop setting, which
could lead to round-tripping issues.

Likewise, the indentation of continuation paragraphs in definition lists
now matches the two-characters leader of the first line for Markua
output.

Fixes: #10890
2025-07-22 19:07:08 +02:00