Commit Graph
17515 Commits
Author SHA1 Message Date
TomBen 07602dedae Update macOS version in GitHub workflows to macos-12 2024-06-23 09:56:09 -07:00
John MacFarlane b07c05a1e5 OpenXML writer: be craftier in adding East Asian font hints.
In some cases we need to break up a long text run including
both western and East Asian text, so that the punctuation in
the western text doesn't become double-wide.

Closes #9817.
2024-06-22 21:37:06 -07:00
John MacFarlane bee5b1fcd1 HTML writer: ensure URI escaping needed for html4.
Unicode characters need not be escaped for html5, and still won't be.

See #9905.
2024-06-22 18:48:55 -07:00
John MacFarlane 2b60b1a1bc RST reader: Support :cite: role with citeproc.
This patch supports a subset of the functionality of the
sphinxcontrib-bibtex extension to Sphinx. See
<https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html>.

Closes #9904.
2024-06-21 23:30:27 -07:00
John MacFarlane 7de74f3404 Add command test for #9358. 2024-06-21 11:15:04 -07:00
John MacFarlane 7786b72584 LaTeX reader: fix parsing of dimensions beginning with ..
E.g., `\kern.1pt`.

Closes #9902.
2024-06-21 11:14:31 -07:00
John MacFarlane 59781abef4 MANUAL: Add a note that column widths aren't supported in pptx...
for Divs with class `columns`. See #9890.
2024-06-19 14:42:15 -07:00
John MacFarlane 34aeb289c9 Textile reader: don't let spans begin right after a symbol.
Closes #9878.
2024-06-18 13:24:59 -07:00
Albert Krewinkel 1e8799ca60 doc/custom-writers.md: document the separator arg of Writer.Blocks
Mention that the default `Writer.Blocks` function in
`pandoc.scaffolding.Writer` takes a separator as an optional second
argument.
2024-06-18 09:13:05 +02:00
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