8674 Commits
Author SHA1 Message Date
John MacFarlane 67fa6cda5c SelfContained: add role="img" to svgs.
This is needed in conjunction with `aria-label` for screen
readers. Completes the fix to #9525.
2024-02-29 12:48:27 -08:00
John MacFarlane 85b3ac3ee1 SelfContained: Add aria-label to svg elements.
Screen readers don't seem to pay attention to an alt attribute on
svg.  But they do read the aria-label. So if there's an alt
attribute, we copy its contents to aria-label, unless there is
already an aria-label. This will make pandoc's output with
`--embed-resources` more accessible.

Closes #9525.
2024-02-29 12:08:02 -08:00
John MacFarlane 6c88c39c6d Docx writer: don't copy over footnotePr in settings.xml...
rom reference.docx. Closes #9522.
2024-02-28 22:34:04 -08:00
John MacFarlane cd460ec9c7 Fix regression in section numbering.
Starting with pandoc 3.1.12, unnumbered sections incremented
the section number.

Closes #9516.
2024-02-28 11:31:05 -08:00
John MacFarlane 87b07c699a Docx reader: ensure that table captions are counted.
Normally these occur outside the table element itself, but they
should still be parsed as captions in this case.

Closes #9518.
2024-02-28 10:05:15 -08:00
John MacFarlane 6f87c9e29a Docx reader: detect caption by style name not id.
The styleId can change depending on the localization.

Partially resolves #9518.
2024-02-28 10:04:31 -08:00
John MacFarlane b4e4da62a3 Docx reader: avoid emitting empty paragraph where caption was. 2024-02-28 10:04:06 -08:00
John MacFarlane 0a5ececcb4 EPUB writer: omit EPUB2-specific meta tag on EPUB3.
This caused a validation failure in epubs with cover images.
Closes #9493.
2024-02-22 23:11:13 -06:00
John MacFarlane 25a994df65 Class: openUrl TLS negotiation fixes.
With the release of TLS 2.0.0, the TLS library started requiring
Extended Main Secret for the TLS handshake. This caused problems
connecting to zotero's server and others that do not support TLS 1.3.
This commit relaxes this requirement.

Closes #9483.
2024-02-20 10:07:58 -08:00
John MacFarlane b103792c17 Minor code cleanup. 2024-02-19 22:00:49 -08:00
John MacFarlane c131f8d4bc Markdown reader: fix regression in link parsing...
with wikilinks extensions.  This fixes a regression introduced
in 3.1.12.  Closes #9481.
2024-02-19 12:46:43 -08:00
John MacFarlane 54b001aa19 Org reader/writer: support admonitions.
Closes #9475.
2024-02-19 11:26:57 -08:00
John MacFarlane a6d85a0c98 Org writer: omit extra blank line at end of quote block. 2024-02-19 11:26:29 -08:00
John MacFarlane 8a0e522c39 Typst writer: ensure that -, +, etc. are escaped at beginning of block.
Our recent relaxing of escaping (#9386) caused problems for
things like emphasized `-` characters that were rendered using
`#strong[-]#`.  This now gets rendered as `#strong[\-]`.

Closes #9478.
2024-02-19 08:52:37 -08:00
John MacFarlane b36052144b LaTeX writer: fix bug when a language is specified in two different ways.
If you used `lang: de-DE` but then had a span or div with `lang=de`, the
preamble would try to load `ngerman` twice, leading to an error.

This fix ensures that a language is only loaded once.

Closes #9472.
2024-02-18 11:44:03 -08:00
John MacFarlane aa759c4300 Powerpoint writer: properly handle math in headings and tables.
This ensures that paragraphs containing math are wrapped in
a `mc:AlternateContent` node as required.

Closes #9465.
2024-02-16 15:39:36 -08:00
John MacFarlane fc55d00376 EPUB writer: omit EPUBv3-specific accessibility stuff on epub2.
Closes #9469.  Fixes a regression in 3.1.12.
2024-02-16 13:42:30 -08:00
John MacFarlane 45b6df537a More fixes for SVG ids with --self-contained.
This generalizes the fix to #9420 so it applies to things like
`style="fill(url(#..."`.

Closes #9467.
2024-02-16 10:06:12 -08:00
John MacFarlane a62eab40f7 PDF: internal cleanup of tex2pdf path.
Distinguish tmpDir and outDir, since they can come apart
in the latexmk case.
2024-02-15 08:54:27 -08:00
John MacFarlane c8d4725134 Fixe whitespace. 2024-02-14 22:44:50 -08:00
John MacFarlane 4b9c78f1ce PDF: avoid readFileLazy.
My hunch is that this is causing improperly cleaned up temp
directory on Windows (#9460), but this will have to be confirmed.
2024-02-14 22:17:26 -08:00
John MacFarlane 1ab99c0551 T.P.Readers: add readDjot to exports. 2024-02-14 08:12:38 -08:00
John MacFarlane 9c0a0a1c56 Man writer: fix bug with long URLs.
URLs with more than 68 characters didn't display properly because
of wrapping.

Closes #9458.
2024-02-14 07:43:57 -08:00
John MacFarlane 7c3a9b6f2f Fix some exports to avoid warnings on older ghc versions. 2024-02-13 23:46:41 -08:00
John MacFarlane 8c42926cb2 Add djot reader and writer.
Djot is a light markup syntax (https://djot.net).

This patch adds djot as input and output formats.

API changes:

Add Text.Pandoc.Readers.Djot
Add Text.Pandoc.Writers.Djot
2024-02-13 23:10:42 -08:00
John MacFarlane ea2466724b Shared.addPandocAttributes: use wrapper attribute, not wrap.
`wrap` is a standard HTML5 attribute.
2024-02-13 22:54:01 -08:00
John MacFarlane a5b691a77e Markdown reader: fix wikilinks extension to allow newlines in titles.
Closes #9454.
2024-02-13 22:20:03 -08:00
John MacFarlane 04520ceaae Man writer: support syntax highlighting (limited).
Currently only boldface and italics are supported.
The `monochrome` style might be of use for those generating
man pages.

Closes #9446.
2024-02-13 21:05:53 -08:00
John MacFarlane cf847b0138 LaTeX reader: improve treatment of cref, Cref.
Associate with `\cref` and `\Cref` the reference-type `ref+label` and
`ref+Label`.  So far we don't do anything fancy with these.
Also, associate with `\vref` `ref` instead of `ref+page`.

See #7463.
2024-02-13 19:32:12 -08:00
John MacFarlane 02b6483b7c Typst writer: use #ref or @ for links with reference-type="ref".
This attribute is added to LaTeX `\cref`, for example.
See #7463.
2024-02-13 19:32:12 -08:00
John MacFarlane 2d83b7ca6f Make LaTeX writer sensitive to empty_paragraphs extension.
Closes #9443.
2024-02-13 15:50:12 -08:00
John MacFarlane d836da7435 LaTeX reader: treat \Cref like \cref (for now).
See #7463.
2024-02-13 08:16:57 -08:00
John MacFarlane aa00714ba4 Typst writer: improve citation support.
Emit `form: "prose"` or `form: "year"` qualifiers if the citation
is author-in-text or suppress-author.

Strip initial comma from suffix, since typst will add an extra
one.

Closes #9452.
2024-02-12 20:01:44 -08:00
Sam May 758ff050b2 HTML5 writer: Add suffix to multiple footnote section ids
The first (and often only) `<aside id=footnotes>` block remains
unchanged, however any additional blocks from `--reference-location` are
distinguished as `#footnotes-2`, `#footnotes-3`, and so on.  No other
existing writer seems to implement per-section IDs, including HTML4.
2024-02-12 18:45:47 -08:00
John MacFarlane bf674e8ddd Markdown writer: use different width fences for nested divs.
Outer divs have longer fences. This aids clarity for the reader,
making it easier to see where the div ends. It also makes the
output compatible with some other implementations, e.g.
micromark, which require different-width fences for nesting.

Closes #9450.
2024-02-12 10:05:36 -08:00
John MacFarlane bd352e41d6 Man reader: move spaces outside of emph/strong.
This is needed to avoid problems in conversion to Markdown
and some other formats. Closes #9445.
2024-02-11 19:06:50 -08:00
John MacFarlane 8c85fbbf2e Powerpoint writer: Fix regression in layout for slides with figures.
Closes #9442.
2024-02-09 16:39:56 -08:00
John MacFarlane 0604fa297d Fix id replacements in SVGs with clipping paths.
This fixes `--embed-resources` when SVGs have `clip-path`
attributes.

Closes #9420.
2024-02-09 16:39:48 -08:00
John MacFarlane ea23868ae4 Fix size of duplicated SVGs with --embed-resources.
Closes #9439.
2024-02-09 16:39:40 -08:00
John MacFarlane 719f31b26b MediaWiki reader: don't make leading blanks underscores...
in image links. See #9425.

(Not a complete fix for this issue, because `:file:` and the like
are still not handled properly.)
2024-02-07 08:42:20 -08:00
John MacFarlane c46bf5948c MediaWiki reader: allow lowercase image:.
Closes #9424.
2024-02-07 08:28:29 -08:00
John MacFarlane e81a60fdf2 Support "pagetotal" in converting BibLaTeX. 2024-02-07 08:15:47 -08:00
John MacFarlane bab30eaf41 Typst reader: improve handling of inline #quote.
Closes #9413.
2024-02-05 08:55:28 -08:00
John MacFarlane 3ef74d1fd2 Typst reader: fix handling of dot(), tilde(), ddot().
See jgm/typst-hs#38.
2024-02-04 22:37:37 -08:00
John MacFarlane 1e05f32ead Typst reader: fix character used for norm.
See jgm/typst-hs#38.
2024-02-04 22:01:26 -08:00
John MacFarlane 0706c7a285 Docx writer: restore ability to center-justify table.
The fix to #5947 caused all tables to be left indented.
This was necessary to avoid extra indentation in table cells
when a table appeared in a list item.  This change makes
the changes conditional, so that they only affect tables
in list items.

Closes #9393.
2024-02-03 22:50:55 -08:00
John MacFarlane 03bb426a4a Shared: makeSections behavior changes.
+ When the optional base level parameter is provided, we no
  longer ensure that the sequence of heading levels is gapless
  [behavior change]. Instead, we set the lowest heading level to
  the specified base level, and adjust the others accordingly. If
  an author wants to skip a level, e.g. from level 1 to level 3,
  they can do that. In general, the heading levels specified
  in the source document are preserved; `makeSections` only
  puts them into a hierarchical structure. Closes #9398.

+ Section numbers are now assigned so that the top level
  gets `1`, no matter what heading level is used. So, even
  if the top heading level is 2, numbers will be `1`, `2`, etc.
  rather than `0.1`, `0.2`, as in the past. Closes #5071.

+ We revert to the old behavior when the `--number-offset` option
  is used. So, for example, if a document begins with a level-3
  heading, and `--number-offset=1,2` is used, the top-level section
  numbers will be `1.2.1`, `1.2.2`, etc. This is mainly for
  backwards-compatibility.
2024-02-03 22:19:29 -08:00
John MacFarlane 6fc8a80c2c Shared.makeSections: more elegant code for section number calculation. 2024-02-03 12:47:48 -08:00
Tomas Dahlqvist 163be37dd6 Using internal column widths in pptx writer tables (#9392)
The table writer used to only divide all available width evenly
for all columns. In this update the code uses the incoming widths
if they are available. If they are not set the earlier even
distribution is used. Some of the golden templates are adjusted
slightly because of different rounding when using the new
calculation model.

Closes #5706
2024-02-01 10:37:12 -08:00
Iacobus1983 3e7e6f014a EPUB accessibility additions (#9400)
AccessModeSufficient and AccessibilitySummary are added.

These metadata are optional according to the EPUB Accessibility 1.1
standard, but ACE Daisy checker flags ebooks for missing them
(cf daisy/ace#389 and daisy/ace#400).

With this commit:

AccessModeSufficient is defaulted to "textual".
AccessibilitySummary can be included via the metadata block.
2024-02-01 10:19:08 -08:00