Commit Graph

18858 Commits

Author SHA1 Message Date
John MacFarlane c8ee9dc545 Docx reader: preserve non-textbox content when unwrapping textboxes.
Previously, when a w:p paragraph contained runs with textboxes,
the entire paragraph was replaced by just the textbox content,
discarding all other runs (including image-bearing runs).
Now we walk the paragraph's children in order, grouping
non-textbox content into copies of the original w:p and splicing
unwrapped textbox content in place, preserving the original order.

We also treat text inside a textbox containing an image as a
figure caption.  (One often finds captioned images of this
kind in docx files.)

Closes #11510.
Closes #6893.
Closes #11412.
Closes #5394.
Closes #9633.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-14 20:12:34 +00:00
John MacFarlane 8aa7a08574 Docx writer: don't depend on extractTarget from Docx reader. 2026-03-12 23:51:21 +01:00
John MacFarlane 244528e044 Docx reader: properly handle media stored with packaged-rooted paths...
...such as /media.  This can be produced by the online version
of Word. (Desktop Word uses paths relative to word/.)  With this change,
media stored at an absolute path will be stored with its original
name and not given a SHA1-based name.

Closes #11518.
2026-03-12 23:28:54 +01:00
Raymond Berger f0d05eb438 Docx reader: Recognize media inside textboxes (#11515)
Closes #11053.
2026-03-12 22:26:17 +01:00
John MacFarlane d39ca219e7 Permit http-client-tls 0.4. 2026-03-12 10:29:41 +01:00
silby 09faceaa0d Remove self from sponsorship recipients (#11519) 2026-03-12 10:22:45 +01:00
John MacFarlane 6219b9ebf6 Use latest dev asciidoc-hs. 2026-03-10 12:26:26 +01:00
John MacFarlane 80c704a9ac Typst writer: properly escape . after bracketed argument.
(When it might be mistaken for field access.)

Closes #11511.
2026-03-09 14:10:53 +01:00
John MacFarlane 661d18b244 Allow tls 2.2. 2026-03-08 09:54:42 +01:00
Peter Briggs 87e00ed944 Fix outdated OPML spec URL in MANUAL.txt (#11504) 2026-03-08 09:52:20 +01:00
John MacFarlane 131cf7ce9b Allow crypton 1.1. 2026-03-07 23:42:44 +01:00
Albert Krewinkel 40b525352d JATS writer: improve representation of divs
The writer now checks if the element used to represent (non-special)
divs has any `<boxed-text>` specific attributes. If it does, the writer
keeps wrapping the div contents in a `<boxed-text>`, as it did before.
Otherwise, the writer falls back to the more appropriate `<p>` element
or simply unwraps the div if the wrapping element wouldn't have any
attributes. The new behavior gives better semantic results in most
cases, as `<boxed-text>` should be used for text that "is outside the
flow of the narrative text", which doesn't apply to most divs.

"Special" divs, like those used to mark sections, are not affected by
this change.
2026-03-06 13:59:04 +01:00
massifrg 15ddf4124c ICML writer support for image object styles (#11498)
This change allows users to style images in InDesign bysetting the
`object-style` attribute in a pandoc Image, which is mapped to the
AppliedObjectStyle attribute in the Rectangle element around
an Image element in the resulting ICML.
2026-03-03 22:31:55 +01:00
John MacFarlane aab99655e9 Use latest dev asciidoc-hs. 2026-03-03 17:07:06 +01:00
John MacFarlane a6ab08da9f MediaWiki writer: use appropriate syntax for external images.
Note that they will only be rendered as images if an
option `$wgAllowExternalImages` is enabled in the MediaWiki instance.

Closes #11494.
2026-03-03 15:38:51 +00:00
dependabot[bot] 929597b7c4 Bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 11:55:41 +01:00
John MacFarlane 104344fe72 PPTX writer: register content type for embedded fonts.
When a reference document contains embedded fonts (.fntdata files),
the content type was not being registered in [Content_Types].xml,
causing PowerPoint to flag the output as corrupted.

Closes #11492.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-28 14:07:54 +00:00
John MacFarlane fd8d755f8a Markdown writer: escape literal & that would trigger entity.
Closes #11490.
2026-02-27 11:51:35 +01:00
Pascal Wagler 72b62843c1 EPUB 3 update allowed values for metadata identifier.scheme (#11485)
- Update allowed values for metadata `identifier.scheme` from ONIX codelist  issue 72.
- Change some `identifier.schema` allowed values to better align with ONIX codelist.
- Update manual.

Closes #11481.
2026-02-25 22:03:33 +01:00
John MacFarlane 086d1f5673 Fix stack.yaml. 2026-02-25 12:58:55 +01:00
John MacFarlane 9bfde3cd9d Use latest dev djoths. 2026-02-25 12:36:05 +01:00
John MacFarlane 1a3a6e4e19 Require auto-update >= 0.2.6 to fix server on macOS.
Version 0.2.5 introduced a dependency on getSystemTimerManager
which fails on macOS. Version 0.2.6 includes a fix that provides
fallback logic for non-threaded runtimes.

Closes #11488.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 11:06:13 +00:00
John MacFarlane f5d8079ad7 Tweak to #11487 - Use fromContext instead of lookupMeta.
This ensures that things will work even if the variable is
set using `--variable`.

Closes #11486.
2026-02-25 11:55:58 +01:00
Christophe Dervieux 7bd9dbecdc Revealjs writer: default scrollProgress to 'auto'.
RevealJS defaults scrollProgress to 'auto', but the writer was
setting it to true.  Use lookupMeta to distinguish between
MetaBool True, MetaBool False, and unset (defaulting to 'auto').
The template uses a helper variable scrollProgressAuto since
pandoc templates cannot distinguish a MetaString "auto" from
MetaBool True in a single variable.
2026-02-25 11:45:30 +01:00
Christophe Dervieux bf96353c48 Revealjs template: fix type rendering of scroll-view options.
Remove quotes from scrollActivationWidth (should be a number,
not a string).  Use $if/$else$ guard for scrollSnap so that
`false` renders as a boolean literal rather than the string
'false'.  Add /nowrap to scrollSnap and scrollLayout.
2026-02-25 11:45:30 +01:00
John MacFarlane d53fa0cffb pandoc-cli.cabal: bump base min bound to 4.18 (same as pandoc). 2026-02-25 10:29:46 +01:00
John MacFarlane e327b2e6ba Revert change to ghc-options in pandoc-cli.
An earlier change removed `-threaded`, which we need.
See #11488.
2026-02-25 10:19:06 +01:00
John MacFarlane a56d98f9c4 HTML styles template: avoid duplicate code selector.
Consolidate two clauses. Closes #11484.
2026-02-23 17:36:50 +01:00
John MacFarlane e270beac1a Docx writer: fix section breaks with --top-level-division.
Previously, the fix for #10578 (removing leading section break to avoid
blank first page) was implemented inside blocksToOpenXML, which is called
recursively for Div contents. Since makeSectionsWithOffsets wraps each
section in a Div, this caused ALL section breaks to be stripped, not just
the first one (#11482).

This commit fixes the issue by tracking whether we've processed the first
section header using a new stFirstSectionHeader state flag. Section breaks
are now correctly added between chapters/parts while still avoiding a
blank first page.

Closes #11482.
See also #10578.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 10:46:18 +00:00
John MacFarlane be5bafcfc9 Markdown writer: Fix rendering of alerts.
We only properly handled the case where the alert started with
a paragraph, but it can start with a list or other block type.

Closes #11479.
2026-02-18 10:21:41 +01:00
Gordon Woodhull e427b7795e typst: use both place and block for title
otherwise the title will be confined to the left column
2026-02-16 23:36:50 +01:00
Jan Tojnar 84e39ff36f Odt reader: Support Preformatted Text from pandoc writer
pandoc generates a separate style class like P123 for each paragraph,
inheriting the desired style using `parent-style-name`.

Previously, we did not support that but it is pretty easy to add.
Though for simplicity this fix does not extend to finding the parent
style recursively when deeper hierarchies are involved.
2026-02-16 13:54:34 +01:00
Jan Tojnar b4f71f7ef0 Odt reader: Support Preformatted Text style
LibreOffice uses `Preformatted_20_Text` as the default style for
code listings etc. Let’s detect if a paragraph has the `style-name`
and convert it to `CodeBlock` if it is the case.

Unfortunately, pandoc itself generates a separate style class like P123
for each paragraph so we will not yet support code listings from documents
generated by pandoc itself.

Closes #4841.
2026-02-16 13:54:34 +01:00
Jan Tojnar 8b994e01a5 Odt reader: Add block smushing logic
This will be necessary once we add support for parsing code blocks.
Just like in Word/OOXML, those are typically represented as one paragraph
per line of code, each having `Preformatted Text` as style name.
2026-02-16 13:54:34 +01:00
Jan Tojnar 598b77517c Odt writer: Modernize Preformatted Text & Source Text styles
Presumably, `font-family-generic` and `font-pitch` will allow to find
a replacement on systems that do not have `Courier New`.
2026-02-16 13:54:34 +01:00
Jan Tojnar c8a64cadb3 Odt writer: Remove font size from inline source class
This matches what LibreOffice Writer is doing.

Also fixes literals inside headings being too small.

Fixes https://github.com/jgm/pandoc/issues/3390#issuecomment-595677619
2026-02-16 13:54:34 +01:00
Jan Tojnar edd6865f1c Odt writer: Rename inline source class to match LibreOffice
Rename the text style we use to represent `Code` inlines from
`Source_20_Text` to `Source_Text`.

This is the same name LibreOffice Writer uses so it will be recognized
by the Character Styles section of the Styles menu.

Closes #3390.
2026-02-16 13:54:34 +01:00
Jan Tojnar 4d7669666a Odt reader: Recognize Preformatted_20_Text style
This is used by LibreOffice, and we will switch to that as well.
2026-02-16 13:54:34 +01:00
Jan Tojnar 9f4a303587 Odt reader: Normalize parametric type names 2026-02-16 13:54:34 +01:00
dependabot[bot] e440511016 Bump wimpysworld/nothing-but-nix from 9 to 10 (#11476)
Bumps [wimpysworld/nothing-but-nix](https://github.com/wimpysworld/nothing-but-nix) from 9 to 10.
- [Release notes](https://github.com/wimpysworld/nothing-but-nix/releases)
- [Commits](https://github.com/wimpysworld/nothing-but-nix/compare/v9...v10)

---
updated-dependencies:
- dependency-name: wimpysworld/nothing-but-nix
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 13:51:54 +01:00
Agriya Khetarpal 5706e504cf Add link to "Pandoc in the browser" demo (#11477) 2026-02-16 13:39:44 +01:00
Tuong Nguyen Manh 1e4fc7254b ODT Reader: Fix relative linked images (#11467)
Like with relative links ODT adds a `../` to relative linked images
which needs to be removed.

Fixes #11369.
2026-02-15 18:20:47 +01:00
John MacFarlane 94dc2de439 EPUB writer: add cover metadata for EPUB3.
Previously, the <meta name="cover" content="..."> element was only
generated for EPUB2. This element is used by file managers to display
cover images as thumbnails. Now it is also generated for EPUB3,
allowing file managers to show cover thumbnails for EPUB3 files as well.

Used epubcheck to verify that the addition of this element does
not compromise EPUB v3 validity.

Closes #11469.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 17:19:40 +00:00
John MacFarlane 93efd39f42 T.P.Writers.GridTable: normalize tables.
Previously, if an invalid table was passed to `toTable`, an
array index error could be raised. Normalizing the table forces
it into a shape that won't allow this error.

Closes #8102.
2026-02-15 18:11:24 +01:00
John MacFarlane cc72b8054c Typst writer: include alt attributes on images.
This borrows a test case taken mostly from #11394 by @mcanouil
but the code is fresh.  The behavior is similar to what we
have with the HTML and LaTeX writers.

Obsoletes #11394.

Co-authored by @mcanouil and Claude Opus 4.6.
2026-02-14 16:19:41 +01:00
John MacFarlane 3c56088b4e LaTeX reader: support \footnotemark and \footnotetext (#11450).
These commands allow separating the footnote mark from its content,
useful in tables, minipages, and other contexts where \footnote
cannot be used directly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Closes #11450.
2026-02-14 14:22:15 +00:00
Jan Tojnar 3b9a47d02e readers/docx: Support w:gridBefore table row property (#11464)
Table rows in Docx files can use `w:gridBefore` property to specify
a number of extra empty table cells to be inserted at the beginning
of a row. Without this, table columns in tables using the element
will become misaligned.

https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.gridbefore?view=openxml-3.0.1

In the worst case, this can lead to cells at the end of some rows
to be dropped by the parser.

The test file was produced as follows based on
the “3GPP TS 24.282 V19.5.0 (2025-12)” document obtained from
<https://www.3gpp.org/ftp/Specs/archive/24_series/24.282/24282-j50.zip>
where I encountered the issue:

1. Extracted the `document.xml`.
2. Formatted it with `xmllint --format`.
3. Found the raw XML for “Table 15.2.13-2: Payload content type”.
4. Removed `w:rsid*` and `w14:*` attributes, and `w:pStyle` elements.
5. Replaced the context of `test/docx/raw-blocks.native`.
6. Used pandoc to generate the docx.
2026-02-14 14:28:03 +01:00
John MacFarlane 1ff422d1dd Actions: improve long line check in pr commit validation.
We allow long URLs on lines by themselves.
2026-02-14 10:13:43 +01:00
John MacFarlane f01b2dfe28 Actions: Remove commit-validation.yml workflow.
This is useless because it runs after the push; we need this
check for pull requests but not for core committers. (They should
use a pre-commit hook.)
2026-02-14 10:13:00 +01:00
John MacFarlane 04848401d5 Typst writer: fix escaping of quotes.
All quotes should be escaped the same way with `smart`; previously
we were treating right and left single quote differently.

Closes #11463.
2026-02-13 11:01:37 +01:00