Commit Graph
2329 Commits
Author SHA1 Message Date
Gokul Rajiv 74add4b126 RST reader: fix figclass and align annotations for figures (#9744)
Fixes #7473 

Previously, `figclass`es weren't being extracted correctly.

`figclass` and `align` annotations are now implemented following the rst docs: these options apply to the figure while other options are passed onto the underlying image.
2024-05-10 15:55:06 -07:00
John MacFarlane 5b9a8ea99c Typst writer: add blank line in definition lists with multiple definitions.
See discussion #9704.
2024-04-28 14:58:18 -04:00
guqicun e2f43baac1 Fix some typos (#9638)
Signed-off-by: guqicun <guqicun@outlook.com>
2024-04-26 10:13:37 +02:00
John MacFarlane 03630a2c6e Update copyright dates to 2024. 2024-04-25 18:16:49 -07:00
John MacFarlane 49df8131a5 Markdown writer: don't try to align columns in pipe tables...
...with lines greater than COLUMNS.

The alignment just reduces readibility when the lines soft wrap.
2024-04-25 14:26:17 -07:00
John MacFarlane f5c7d4dcf7 Markdown writer: don't use raw_attribute syntax for raw...
blocks, unless there is no other option.

Mainly this is motivated by #9677.  If we put raw tex in a
raw_attribute block, then the macros don't get interpreted
when it is read again by pandoc's markdown reader.
2024-04-23 15:45:55 -07:00
John MacFarlane f366e5f638 LaTeX reader: fix over-eager macro expansion in conditionals.
Closes #9676.
2024-04-21 09:01:16 -07:00
John MacFarlane 30442b7f9d Change to --file-scope behavior.
Previously a Div with an identifier derived from the filename
would be added around the contents of each file.  This caused
problems for "chunking" files into chapters, e.g. in EPUB.

We no longer add the surrounding Div. This cooperates better with
chunking. Note, however, that if you have relied on the old
behavior to link to the beginning of the contents of a file using
its filename as identifier, that will no longer work.

Closes #8741.
2024-04-20 16:28:42 -07:00
mbracke a331a1c00a Docx reader: fix anchor in header after anchor (#9626)
When the last parPart before a header was a bookmark, no span with an
anchor was added for a bookmark in the header. But the function that
adds header anchors to the anchor map, needs a span with an anchor.
So this commit adds that span.
2024-04-18 09:32:48 -07:00
John MacFarlane 96add8b9cc Command tests: include regular PATH...
...after directory with the test executable.
I want to see if this fixes the CI problem on Windows, which
may be due to problems finding a DLL.
2024-04-15 10:19:41 -07:00
John MacFarlane 0f8086cbd3 Fix command test for #9652. 2024-04-15 10:19:22 -07:00
Carlos Scheidegger 52ee4f109f SelfContained: merge 'class' attr when both img and svg specify it (#9653)
Closes #9652.
2024-04-15 09:44:30 -07:00
Gordon Woodhull 99a45917ac Typst writer: property output (#9648)
The Typst writer will pass on specially marked attributes as raw Typst
parameters on selected elements. This allows extensive customization
using filters.

An attribute with key `typst:PROP` will set the PROP parameter on
the corresponding Typst element.

An attribute with key `typst:text:PROP` will set a parameter on a Typst
`#set text()` rule or a text element.

The feature has been implemented for the following elements:

* span text
* div and div text
* table and table text
* table cell and table cell text

It would be possible to support more elements in the future.

A separate document has been added that provides extensive
documentation and examples of the use of this feature.
2024-04-15 09:32:32 -07:00
John MacFarlane bc9f990256 OpenDocument writer: implement custom-style for spans.
Closes #9657.
2024-04-14 11:29:56 -07:00
John MacFarlane 066d1ba7ef reference.docx: use current standard Word theme.
This includes using the sans-serif font Aptos instead of
the serif font Cambria.

See #7280.
2024-04-13 22:31:20 -07:00
John MacFarlane e0f37996b3 reference.docx: stay closer to Word's current defaults.
We use the default styles for headings and the title instead
of what pandoc was using.

See #7280.
2024-04-13 18:15:04 -07:00
John MacFarlane b6b668ee3f Use conventional styles/indents for Word bullet lists.
See #7280.
2024-04-13 11:44:09 -07:00
John MacFarlane a0c1bdeb8b Markdown reader: auto-close unclosed divs.
This applies to both fenced and HTML-ish varieties.
Otherwise we face an exponential performance problem with
backtracking.

This also accords with the behavior of the `fenced_divs`
extension in commonmark.

A warning is issued when a div is implicitly closed.

Closes #9635.
2024-04-10 17:18:05 -07:00
John MacFarlane 91e758590d LaTeX writer: improve treatment of math inside soul commands.
soul commands (`ul`, `hl`, `st`) are very fragile and the math
must be handled specially.  In #9597 we improved this for strikethrough
but omitted the other soul environments. This patch generalizes the
fix and a related fix for verbatim (#1294, #5529).
2024-04-08 08:53:47 -07:00
John MacFarlane c0768e87cf Org reader: Fix treatment of id property under heading.
Cloess #9639.
2024-04-06 18:24:54 -07:00
John MacFarlane e1f4594272 DokuWiki reader: fix issues with links.
- Link text cannot contain formatting (e.g., `//` is not italics).
  Closes #9630.
- An explicitly empty link text (`[[url|]]`) works the same as an omitted
  link text. Closes #9632.
2024-04-04 10:13:02 -07:00
John MacFarlane c29c18a003 Put $ or $$ around math in csljson output.
Closes #9616.
2024-04-01 12:54:12 -07:00
John MacFarlane b28dc15817 LaTeX writer: fix math inside strikeout (closes #9597). 2024-03-22 08:50:20 -07:00
John MacFarlane 604f541b0f Typst writer: support Typst 0.11 table features. (#9593)
* Typst writer: support Typst 0.11 table features.

- colspans
- rowspans
- cell alignment overrides
- relative column widths
- header and footer
- multiple table bodies with intermediate headers

Row heads are not yet supported.

The default typst template has been modified so that tables
don't have lines by default. As is standard with pandoc, we only
add a line under a header or over a footer. However, a different
default stroke pattern can easily be added in a template.

Closes #9588.
2024-03-20 14:25:08 -07:00
John MacFarlane ebcae86cf4 DocBook reader: add empty title to admonition div if not present.
This allows admonition elements (e.g. `<note>`) to work with
gfm admonitions even if the `<title>` is not present.

Closes #9569.
2024-03-19 08:09:54 -07:00
John MacFarlane 27ee5a7696 Change lhs tests so they don't use --standalone.
This will avoid test failures due to minor changes in
skylighting versions, e.g. #9589.
2024-03-19 07:58:42 -07:00
John MacFarlane d89167d25f Typst writer: more reliable escaping in inline [..] contexts.
For example, we need to escape `[\1. April]` or it will be
treated as an ordered list.

Closes #9586.
2024-03-18 11:43:41 -07:00
John MacFarlane c5c7022ac5 Typst writer: handle unnumbered on headings.
Closes #9585.
2024-03-18 10:13:51 -07:00
John MacFarlane a1aca22e0d LaTeX reader: better handling of colwidths.
Previously the parser just failed if the column width
specified in `p{}` wasn't a multiple of `\linewidth`.
This led to cases where content was skipped.
Now we treat these as ColWidthDefault and silently
parse the table.

A future improvement could be to guess relative column
widths from the dimensions specified, based on a default
line width.

Closes #9579.
2024-03-17 19:15:49 -07:00
John MacFarlane 660823e2ec Typst writer: only use explicit figure 'kind' for tables.
The rest of the time the autodetection should work fine.
2024-03-17 15:46:17 -07:00
John MacFarlane 2c5d66cb5c Typst writer: use kind: image for image figures. 2024-03-17 11:39:32 -07:00
John MacFarlane a6392207fc Typst writer: avoid unnecessary box around image in figure.
See #9236.
2024-03-17 11:29:25 -07:00
John MacFarlane 9ae7557ac0 Typst writer: omit width/height in images unless explicitly specified.
Previously we computed width/heigth for images that didn't have
size information, because otherwise typst would expand the image
to fit page width. This typst behavior has changed in 0.11.
This change fixes a bug in which images would sometimes overflow
page margins, depending on their intrinsic size.

Closes #9236.
2024-03-17 10:59:47 -07:00
John MacFarlane 2514ad2531 Typst template: set table inset globally. 2024-03-16 10:26:14 -07:00
John MacFarlane ea3719818b Typst writer: don't add inset to tables.
This hardcoded `inset` prevented global customizations in
a template.

Closes #9580.
2024-03-16 10:26:14 -07:00
John MacFarlane 95661b6a05 Markdown reader: Fix bug with footnotes at end of fenced div.
Cloess #9576.
2024-03-14 11:04:26 -07:00
John MacFarlane 876bd49786 Typst writer: add 'kind' parameter to figures.
This helps to distinguish tables from other figures for
purposes of labeling and numbering.

Closes #9574.
2024-03-14 10:16:51 -07:00
John MacFarlane b2b04a2f1c Use djot 0.1.1.2, update tests.
djot 0.1.1.1 was horribly buggy and dropped content after lists.
2024-03-14 10:11:04 -07:00
John MacFarlane 69eab3fce5 Fix test for #9555. 2024-03-10 11:42:40 -07:00
John MacFarlane 812f82ab09 LaTeX reader: improve tokenization of @.
Make tokenization sensitive to `\makeatletter`/`\makeatother`.
Previously we just always treated `@` as a letter.  This led
to bad results, e.g. with the sequence `\@`.  E.g.,
`a\@ b` would parse as "ab" and `a\@b` as "a".

Closes #9555.
2024-03-10 11:14:41 -07:00
John MacFarlane 626ffd74b4 LaTeX reader: Make withRaw work inside parseFromToks.
This is needed for raw environments to work inside table cells.

Closes #9517.
2024-03-09 12:53:13 -08:00
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 4ca2de1715 Update test suite for latest skylighting-format-blaze-html. 2024-02-27 20:02:52 -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