Commit Graph

1181 Commits

Author SHA1 Message Date
John MacFarlane 1ac4030c1a Rename command test for 10047 -> 11047.
Commit 2c857d3 closed #11047 but was mislabeled as closing #10047.
2025-08-17 17:53:32 +02:00
John MacFarlane 5e50e4e605 Citeproc: don't move footnotes around em-dashes.
Closes #11046.
2025-08-17 17:45:36 +02:00
John MacFarlane 2c857d379b Typst writer: add escapes to prevent inadvertent lists...
due to automatic wrapping.

Also simplify existing code that was meant to do this.

Closes #10047.
2025-08-17 17:45:36 +02:00
Albert Krewinkel de31a9f130 Org reader: accept quoted values as argument values.
Fixes: #8869
2025-08-14 19:35:37 +02:00
John MacFarlane a6a5be132a Typst writer: add parens around typst-native year-only citations.
Closes #11044.
2025-08-12 22:43:27 -07:00
John MacFarlane 0bbbdbcdb6 LaTeX reader/writer: change handling of math environments.
Certain environments in LaTeX will trigger math mode and can't
occur within math mode: e.g., `align` or `equation`.  Previously
we "downshifted" these, parsing an `align` environment as a
Math element with `aligned`, and an `equation` environment as a
regular display math element.  With this shift, we put these in
Math inlines but retain the original environments.

This works because:

1) texmath handles these environments just fine,
2) and so does MathJax;
3) when writing LaTeX we detect these environments in Math elements
   and emit them verbatim instead of putting them in `$..$` or
   `$$..$$`.

Closes #9711. Closes #9296.
2025-08-11 17:40:41 -07:00
Albert Krewinkel a5312c0828 LaTeX reader: parse \minisec as unlisted level 6 headings.
Closes: #10635
2025-08-10 18:36:52 -07:00
Albert Krewinkel 7639e800c5 Org template: add #+options lines if necessary
The default template now adds `#+options` lines if non-default settings
are used for the `smart_quotes` and `special_strings` extensions.
2025-08-06 12:54:12 -07:00
Joseph Reagle c1a4ae1abb Update 11013.md (#11020)
Original test had a poor/misleading title.
2025-08-04 13:05:16 -07:00
John MacFarlane bc3a8a663d Typst reader: handle inline-level show rules on block content.
Typst allows things like `smallcaps` to be applied to block-level
content like headings.  This produces a type mismatch in pandoc,
so before processing the output of typst-hs, we transform it,
pulling the block-level elements outside of the inline-level
elements.

Closes #11017.
2025-08-03 15:20:11 -07:00
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 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
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 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
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 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
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
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
John MacFarlane e037059a3a Fix a test. 2025-07-20 17:50:41 -07:00
John MacFarlane 498ef4bf24 Fix pandoc-citeproc-64 test.
It was meant to test subsequent author substitution, but the
new chicago-author-date doesn't do this. So we use a different CSL.
2025-07-20 15:30:14 -07:00
John MacFarlane c9c0328179 Fix citeproc-87 test.
When we updated to the latest chicago-author-date.csl, this test
no longer tested what it was supposed to; so we use a different csl.
2025-07-20 15:29:55 -07:00
John MacFarlane f4eca1f3fb Use latest dev citeproc and update the default CSL...
from the latest chicago-author-date.csl. (Note that this goes
from the 17th to the 18th edition.)

Update tests.
2025-07-20 00:12:15 -07:00
John MacFarlane 826f487818 Typst writer: set lang attribute in Divs.
Closes #10965.
2025-07-14 11:52:22 -07:00
John MacFarlane b57d3f9b4d Markdown writer: better handling of pandoc-generated code blocks.
Omit the wrapper sourceCode divs added by pandoc around code blocks.

More intelligently identify which class to use for the one class
allowed in GFM code blocks.  If there is a class of form `language-X`,
use `X`; otherwise use the first class other than `sourceCode`.

Closes #10926.
2025-06-20 13:42:31 -07:00
John MacFarlane 3d124e5d39 DocBook reader: be sensitive to startingnumber attribute...
on ordered lists.  Closes #10912.
2025-06-16 12:44:24 -07:00
John MacFarlane 332fffb89a LaTeX reader: support \ifmmode.
Closes #10915
2025-06-16 10:39:58 -07:00
John MacFarlane ccec1e0b65 Docx reader: handle strict OpenXML as well as transitional.
Closes #7691.
2025-06-03 12:15:04 -07:00
John MacFarlane add83e8169 Markdown reader: make definition lists behave like other lists.
If the `four_space_rule` extension is not enabled,
figure out the indentation needed for child blocks dynamically,
by looking at the first nonspace content after the `:` marker.

Previously the four-space rule was always obeyed.

Remove the old `compact_definition_lists` extension. This was
neded to preserve backwards compatibility after pandoc 1.12
was released, but at this point we can get rid of it.

T.P.Extensions: remove `Ext_compact_definition_lists` constructor
for `Extension` [API change].

Fix tight/loose detection for definition lists, to conform to
the documentation.

Closes #10889.
2025-06-02 23:29:47 -07:00
John MacFarlane 78efe58641 T.P.Writer.Shared gridTable: more grid table fixes.
Fix headings with colspans. If the heading contains a colspan, we still
need to include information in the header line about the colspecs.

Fix headerless tables.  The top line should encode colspan information.

Closes #10855.
2025-05-28 12:46:00 -07:00
Benjamin Esham ccc0a5a630 HTML writer: use the ID prefix in the ID for the footnotes section.
In commit 9190b19fc, we began to use the ID prefix for the <aside>
holding the footnotes. In commit 41da8ad9e, we started to use a
<section> for this instead and the ID-prefix functionality was lost.
This commit resumes using the ID prefix in the ID of this element so
that multiple documents can be combined into one without ID conflicts.
2025-05-27 08:53:33 -07:00
Nikolay Yakimov 8d93cd7949 Markdown writer: preserve figure attributes
0d2114e introduced a bug where Markdown writer would ignore attributes
on the figure if it has class or key-value attributes set.

This commit fixes that and adds a regression test.

Closes #10867
2025-05-26 20:38:40 -07:00
John MacFarlane 28e01fac74 LaTeX writer: include alt option in \includegraphics.
Closes #6095.
2025-05-26 20:29:20 -07:00
John MacFarlane 5c4ca5b75b SelfContained: fix handling of empty script element.
Previously in this case the closing tag was dropped.

Closes #10862.
2025-05-26 19:02:44 -07:00
John MacFarlane fbeadcd0ba gridTables: properly handle columns with all empty cells.
See #10848.
2025-05-17 09:59:17 -07:00
John MacFarlane ca321e1b75 Fix problems with gridTable and add tests.
Closes #10848.
2025-05-16 18:10:06 -07:00
John MacFarlane 5af4c7024c Add failing test for complex grid tables with row/colspans.
See #10848.
2025-05-15 15:02:37 -07:00
John MacFarlane adc05a6cd4 gridTable: more improvements to colspan handling. 2025-05-15 14:57:45 -07:00
John MacFarlane 1f290db770 Add a failing test for #10848 grid table. 2025-05-15 13:28:18 -07:00
John MacFarlane 01257ef6eb T.P.Writers.Shared: New version of gridTable.
This handles row and colspans. Partially addresses #6344.

It also ensures that cells won't wrap text in places where it
wouldn't normally wrap, even if this means making the cells wider
than requested by the colspec. (Closes #9001.  Closes 7641.)

Parameters are different, so this is a breaking [API change].

Markdown, RST, and Muse writers have been adjusted to
use the new `gridTable`.
2025-05-14 14:31:39 -07:00
John MacFarlane bfcff3eb99 Org reader: change handling of inline TeX.
Previously inline TeX was handled in a way that was different
from org's own export, and that could lead to information loss.
This was particularly noticeable for inline math environments
such as `equation`.  Previously, an `equation` environment
starting at the beginning of a line would create a raw block,
splitting up the paragraph containing it (see #10836).
On the other hand, an `equation` environment not at the beginning
of a line would be turned into regular inline elements
representing the math. (This would cause the equation number to
go missing and in some cases degrade the math formatting.)

Now, we parse all of these as raw "latex" inlines, which will be
omitted when converting to formats other than LaTeX (and other
formats like pandoc's Markdown that allow raw LaTex).

Closes #10836.
2025-05-11 17:38:18 -07:00
John MacFarlane 60b4011902 DocBook reader: improve handling of literallayout.
This is now only made a CodeBlock when there is a `monospaced`
class.

Otherwise it is made a LineBlock.

Closes #10825.
2025-05-08 11:19:54 -07:00
Manolis Stamatogiannakis 7f9c776b97 Plain writer: Support the four_space_rule extension. (#10813)
Allows using `-t plain+four_space_rule` to emulate the output of pandoc
before #7172. This is useful for users that use pandoc e.g. to
autoformat commit messages.
2025-04-28 16:06:31 -07:00
John MacFarlane 8e9d90504c Typst writer: handle equation labels with spaces.
Closes #10805.
2025-04-26 17:32:45 -07:00
John MacFarlane fb5499d7af Typst writer: add equation label if math contains \label{..}.
Closes #10805.
2025-04-25 22:39:56 -07:00
John MacFarlane ec08f03782 OpenDocument writer: fix character styles in footnotes.
Character styles governing the position of the footnote
reference should not be imposed on the footnote text.
Closes #10791.
2025-04-18 10:47:47 -07:00