Commit Graph
17506 Commits
Author SHA1 Message Date
John MacFarlane 532bbc875b Use latest commonmark-extensions.
This fixes `auto_identifiers` and `ascii_auto_identifiers`
extensions so that they substitute aliases for emojis,
as documented.

See #9876.
2024-06-17 19:57:33 -07:00
John MacFarlane 80ad2f09d3 Use latest emojis release. 2024-06-17 18:52:18 -07:00
John MacFarlane 97b3056f4e Make gfm_auto_identifiers work as advertised.
It is supposed to replace emojis with their aliases,
but previously this only worked when the emojis were
in a specially marked span.

Note that this change doesn't affect `commonmark` (or `gfm`)
because the relevant code is in commonmark-hs. This will also
need updating.

See #9876.
2024-06-17 13:41:31 -07:00
John MacFarlane fde7908091 Markdown writer: don't print extra caption when using implicit_figures. 2024-06-12 23:00:58 -07:00
John MacFarlane 94975a4e3c Docx reader: improve handling of captions.
- Turn captioned images into Figure elements. Closes #9391.
- Improve the logic for associating elements with captions.
  Closes #9358.
- Ensure that captions that can't be associated with an
  element aren't just silently dropped. Closes #9610.
2024-06-12 22:31:33 -07:00
John MacFarlane b2f0d8e799 Docx reader: rename TblCaption to Capt.
We'll use this for image captions as well. Word does not really
distinguish these.
2024-06-12 10:27:32 -07:00
John MacFarlane 7e89a47f2e T.P.ImageSize: don't prefer exif width/height when they conflict...
...with width/height.  That was a mistaken call in #6936.
Usually when these values disagree, it is because the image
has been resized by a tool that leaves the original exif values
the same, so the width/height metadata are more likely to be
correct that exif width/height.

Closes #9871.
2024-06-11 16:44:23 -07:00
Albert Krewinkel e6f298f19f doc/lua-filters.md: Fix outdated docs
Documentation of math and quoting related functions and fields was
updated. The docs had been outdated since at least pandoc 2.17.
2024-06-11 16:45:24 +02:00
John MacFarlane cd9753d4af LaTeX writer/template: specify language option for selnolig...
...and only include it if `english` or `german` is used.

Since 3d8f011, the babel language is not specified as a
class option any more; so now we need to explicitly specify
the language option when we load `selnolig`.  Only `german`
and `english` are valid, so we construct the variable
`selnolig-langs` in the writer and include `selnolig` if it
is nonempty.

This should restore proper ligature suppression when
lualatex is used.

Closes #9863. Supersedes #9864.

Thanks to @fkohrt for the initial fix.
2024-06-10 19:33:43 -07:00
John MacFarlane c9a3f5466e SelfContained: strip CRs from XML before base64 encoding for data uri.
This is motivated mainly by the desire to get tests to work on Windows.
2024-06-10 12:48:35 -07:00
John MacFarlane f2092f82ff SelfContained: only create svg elements for SVG images when...
...the image has the class `inline-svg`. Otherwise just use a
`data` URI as we do with other images.

Closes #9787.
2024-06-10 10:59:16 -07:00
John MacFarlane 71e17b83b9 Use dev skylighting-core. 2024-06-10 09:16:11 -07:00
John MacFarlane 8e227ab059 LaTeX template: put babel-lang in options to beamer.
This is required to make beamer use proper localized terms for
things like "Section." Closes #9868.
2024-06-10 08:57:05 -07:00
Albert Krewinkel 7b85353780 doc/lua-filters.md: correct return type of pandoc.layout.render. 2024-06-10 07:28:00 +02:00
Albert Krewinkel d416619298 doc/lua-filters.md: Document operators of the "Doc" type. 2024-06-10 07:10:15 +02:00
Albert Krewinkel da4a55a985 lua-filters: auto-generate docs for pandoc.layout module. 2024-06-09 22:19:57 +02:00
Albert Krewinkel 042eb1782a CI: bump remaining actions/checkout from v3 to v4 2024-06-09 17:04:11 +02:00
Albert Krewinkel b91d3beaff stack.yaml: bump resolver to lts-22.24.
This shortens the list of extra-deps.
2024-06-09 16:30:33 +02:00
Albert Krewinkel 2cc9defda4 Lua: split Init module into more modules.
The module has grown unwieldy and is therefore split into three internal
Haskell modules, `Init`, `Module`, and `Run`.
2024-06-09 16:10:38 +02:00
John MacFarlane 684668db1e Fix --toc-depth with beamer output.
Previously only top-level sections were ever included in the TOC,
regardless of the setting of `--toc-depth`.

Closes #9861.
2024-06-08 17:35:00 -07:00
Albert KrewinkelandCarsten Gips 9af5b1ca8b Lua: add function pandoc.template.get.
The function allows to specify a template with the same argument value
that would be used with the `--template` command line parameter.

Closes: #9854

Co-authored-by: Carsten Gips <cagix@hsbi.de>
2024-06-08 08:42:47 -07:00
Albert Krewinkel 11a2f78cda PandocMonad: convert IOErrors to warnings when fetching absolute paths (#9859) 2024-06-08 08:40:42 -07:00
Albert Krewinkel 7db19d8cd4 Update more copyright dates to 2024. 2024-06-08 16:46:42 +02:00
Albert Krewinkel c290ffbaff Fix misplaced span. 2024-06-08 14:48:15 +02:00
Albert Krewinkel 6a88abae3d Lua: keep CommonState object in the registry
The state is an internal value and should be treated as such. The
`PANDOC_STATE` global is merely a copy; unsetting the global no longer
breaks the Lua engine.
2024-06-08 14:39:58 +02:00
Albert Krewinkel d50bd30324 Lua: add tests for PANDOC_STATE global 2024-06-08 14:39:58 +02:00
Albert Krewinkel 6f98149516 Fix "unused variable" warning. 2024-06-08 14:39:57 +02:00
John MacFarlane a6427fc95d MANUAL: fixed links to option--reference-doc. 2024-06-07 16:13:02 -07:00
John MacFarlane a0ba712b70 Textile writer: get rid of header, odd, even classes on tr.
This follows #9376.
2024-06-07 14:22:50 -07:00
John MacFarlane b4b0a6d61b Fixes to #9376. 2024-06-07 14:16:38 -07:00
ThomasSoeiro cd15313216 Don't emit unnecessary classes in HTML tables (#9376)
Pandoc used to emit a `header` class on the `tr` element that forms the table header. This is no longer needed, because `head > tr` will do the same thing.

Similarly, pandoc used to emit `even` and `odd` classes on `tr`s, allowing striped styling.  This is no longer needed, because one can use e.g. `tbody tr:nth-child(2n)`.

We now omit these classes, which have a good chance of conflicting with classes used for other things.

Closes #9325.
2024-06-07 12:15:40 -07:00
Albert Krewinkel bfb0475d67 doc/lua-filters: autogenerate docs for module pandoc.template 2024-06-07 20:36:29 +02:00
Albert Krewinkel 430d525378 Lua: allow passing an environment to run_lua_filter.
The default is now to use a *copy* of the global environment when running a
filter; this ensures better separation when `run_lua_filter` is used multiple
times. A custom environment can be specified via the optional third parameter.
2024-06-07 08:36:24 +02:00
John MacFarlane 3d6a4d870a Fix warning. 2024-06-04 17:16:38 -07:00
John MacFarlane 0698eb4a8b LaTeX writer: task lists must be unordered.
Closes #9185.
2024-06-04 17:11:03 -07:00
John MacFarlane 3952d4d1a2 Docx reader: support task lists.
This also fixes a small bug in parsing delimiters in numbered lists,
which led to the default delimiter being used wrongly in some cases.

Closes #8211.
2024-06-04 15:17:43 -07:00
John MacFarlane e71f171fe2 T.P.Writers.Shared: export toTaskListItem instead of isTaskList.
This is more useful.  Use this in OpenXML and HTML writers.
2024-06-04 11:45:04 -07:00
John MacFarlane 75afa7829b T.P.Readers.Docx.Lists: replace a generic traversal...
using `bottomUp` with a faster one using `walk`.
2024-06-04 10:22:38 -07:00
John MacFarlane f5531f18a5 Docx writer: better formatting for task lists.
Task lists are now properly formatted, with no bullet.

In addition, we have removed an expensive generic traverse to
remove Space elements, and replaced it with code in
`inlinesToOpenXML`.  This should give better performance; it
also reduces XML size in the metadata, which wasn't previously
affected by the de-Spacing.

TODO: parse this in the reader so that we can have task lists round-trip.

Closes #5198.
2024-06-04 10:03:26 -07:00
John MacFarlane c4f530fac8 T.P.Writers.Shared: export isTaskList.
[API change]

This function used to be in T.P.Writers.HTML.
2024-06-04 09:12:36 -07:00
John MacFarlane d43a92ebdc Use latest dev citeproc. 2024-06-03 11:02:16 -07:00
Carlos Scheidegger 347985fb83 typst,table - support '.typst:no-figure' and 'typst:figure:kind=kind' (#9778)
This extends support for fine-grained properties in Typst.

If the `typst:no-figure` class is present on a Table, the table will not be placed in a figure.

If the `typst:figure:kind` attribute is present, its value will be used for the figure's `kind`.

These features are documented in `doc/typst-property-output.md`.

Closes #9777.
2024-06-03 09:52:53 -07:00
John MacFarlane b9491ccbbc Support supplementary-material in metadata for jats_articlepublishing.
See #9818.
2024-06-03 09:37:35 -07:00
John MacFarlane 39c549caad Docx writer: omit jc attribute on table cells with AlignDefault.
Closes #5662.
2024-06-01 22:31:03 -07:00
John MacFarlane 1992913ba5 Docx reader: react to "left" value on jc attribute.
Also fix tests.
2024-06-01 21:02:11 -07:00
John MacFarlane 3dfac974d0 Docx reader: handle column and cell alignments.
OpenXML doesn't have a way of indicating column alignments, but
we guess them by looking at the justification property on the
first paragraph of a cell, if there is one.

We take the column alignments from the first body row.

Closes #8551.
2024-06-01 20:01:48 -07:00
John MacFarlane 9a7fd6e7bf Docx reader: allow insertion/deletion to contain arbitrary ParParts...
...and not just Runs.  This fixes a problem wherein comments
inside insertions or deletions would be ignored. Closes #9833.
2024-06-01 17:34:36 -07:00
John MacFarlane aeb84b5d13 Fix command test #6285 for Windows. 2024-06-01 16:21:39 -07:00
Albert Krewinkel 83de55bb35 Lua: Set pandoc.List as default metatable for JSON lists
Lists created by `pandoc.json.decode` now behave like lists generated
via `pandoc.List`. This also ensures that `pandoc.List` tables are
encoded as JSON arrays when passed to `pandoc.json.encode`.

Fixes: #9834
2024-06-01 21:10:29 +02:00
John MacFarlane 075ed1052f Support HorizontalRule in docx reader.
We support both pandoc-style and the style described at
https://support.microsoft.com/en-us/office/insert-a-horizontal-line-9bf172f6-5908-4791-9bb9-2c952197b1a9

Closes #6285.
2024-06-01 11:00:37 -07:00