Commit Graph
19478 Commits
Author SHA1 Message Date
Samuel Huang f40cbd712e CI: add GHC 9.14 to test matrix (#11910)
GHC 9.14 ships base 4.22 and containers 0.8, newer than the bounds of
serialise, cborg, and haddock-library allow.  Relax them under
impl(ghc >= 9.14) so other lanes are unaffected, and force -fhttp on
the 9.14 lane: given the choice, the solver prefers disabling the
http flag to violating bounds.
2026-09-26 21:43:03 -07:00
John MacFarlane 4bcdbb2d0f Docx writer: add FirstParagraph class after display math.
This way the continuation text can be styled flush-left
in a style where normal paragraphs are indented.

Closes #11900.
2026-09-26 16:37:25 -07:00
Samuel Huang 0bde362483 Typst reader: handle block content in inline element bodies (#11881)
Inline elements with a content body (emph, strong, underline, strike,
sub, super, smallcaps, highlight, link, lower, upper, ...) failed with
a parse error when the body contained a paragraph break or other block
content, since inline handlers parse their bodies with pInlines, which
cannot consume paragraph breaks. Example:
```
#emph[hi

there]
```
Generalize `fixNesting`, which already hoisted single block children out
of inline elements (#11017): the content of an inline element is now
split at paragraph breaks and at block children; inline runs are
wrapped back in the element, and block children are pulled out with
the styling applied to their own contents when they have a body. A
pandoc inline cannot span paragraphs, so this is the closest
structural rendering; the paragraph structure is preserved.

Remove the kludge we used for `#quote`, using `getInlineBody`; it
is no longer needed with this general fix.
2026-09-26 15:49:54 -07:00
John MacFarlane 8fa2e6eb95 Docx writer: treat a "mixed" widths table as all-default.
Previously if some columns were ColWidthDefault and others ColWidth 0.x,
we would get columns with a specified width of 0 for the default ones.
Instead, treat all columns as default in this case.

Closes #11899.
2026-09-26 12:49:26 -07:00
John MacFarlane 2daeb548f5 Typst reader: handle #par (explicit paragraph element). 2026-09-25 23:01:54 -07:00
John MacFarlane 30bad891f9 Update all-cabal-hashes in flake.lock 2026-09-25 10:47:52 -07:00
John MacFarlane 8c384bded8 Finish fixing plugin URLs in reveal.js template. See #11907. 2026-09-25 10:47:39 -07:00
John MacFarlane ecd14f3766 Update changelog. 2026-09-25 10:43:58 -07:00
John MacFarlane 472e97587f Add tools/benchplot.js.
This creates a nice graph comparing two benchmarks.
2026-09-25 10:05:07 -07:00
John MacFarlane 9d23a0cb8e reveal.js template: fix plugin paths.
They should be `dist/plugin/`, not `plugin/`.

Closes #11907.
2026-09-25 10:05:07 -07:00
Robert SzarkaandClaude c51b6a6a0a Docx writer: write link titles as ScreenTips.
A link with a non-empty title now gets a `w:tooltip` attribute on its
`w:hyperlink`, which Word shows as a ScreenTip and the docx reader
reads back as the title.

Closes #11869.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-24 23:43:02 -07:00
Robert SzarkaandClaude 8d774fa17a Docx reader: read ScreenTips as link titles.
A hyperlink's ScreenTip is stored as `w:tooltip` on `w:hyperlink`,
for external and internal links alike. It now becomes the title of
the Link instead of being discarded.

The test document was made in Word for Microsoft 365 (Version 2609,
Build 16.0.20430.20032) on Windows 11 25H2 (OS Build 26200.9168).

See #11869.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-24 23:43:02 -07:00
John MacFarlane 6dc562c810 Allow crypton 2.0.x. 2026-09-24 23:00:37 -07:00
John MacFarlane 0d82a40d2b Update flake.lock. 2026-09-24 22:51:31 -07:00
John MacFarlane f0a20d4372 Use commonmark 0.3.1, commonmark-extensions 0.2.7.3 2026-09-24 12:41:16 -07:00
John MacFarlane 67d6f6b970 Makefile: add LOG.md target 2026-09-24 12:40:27 -07:00
John MacFarlane 7980fa7b75 Update flake.lock. 2026-09-23 21:08:31 -07:00
John MacFarlane da10a184f2 Depend on released typst 0.12 2026-09-23 20:36:41 -07:00
John MacFarlane eafa5e2327 Depend on released djot 0.1.4.3 2026-09-23 20:32:06 -07:00
John MacFarlane c8c68ec0ae Markdown reader: reset sourcepos in parseWithString'...
...when parsing a block quote or list item. Otherwise
it can happen that by the time parseWithString' is called,
the position has already been set to the next file on the
command line.

Closes #11888.

Closes #11888.
2026-09-23 20:16:34 -07:00
John MacFarlane 7990086504 Use released commonmark, commonmark-extensions, commonmark-pandoc. 2026-09-23 19:40:11 -07:00
John MacFarlane 8070acec23 Use released texmath 0.13.3 2026-09-23 19:40:11 -07:00
John MacFarlane da7a07a54d ODT reader: handle textProperties on paragraph styles.
Previously these just got ignored, not applied to the paragraph's
text.

Cloess #2623.
2026-09-23 18:14:44 -07:00
John MacFarlane 2ddd82c041 Depend on released doctemplates 0.11.1. 2026-09-22 16:53:51 -07:00
John MacFarlane 83e3c30c9c flake.nix: parse allow-newer and allow-newer-deps in stack.yaml. 2026-09-22 14:00:07 -07:00
John MacFarlane adc4c15370 Add the needed allow-newer for doclayout 0.6. 2026-09-22 13:30:47 -07:00
John MacFarlane 8f3e681bcd pandoc-lua-engine: allow doclayout 0.6 2026-09-22 13:30:41 -07:00
John MacFarlane b3cb03129c Update flake.lock - all-cabal-hashes 2026-09-22 13:30:28 -07:00
John MacFarlane 5820b2c5ad Depend on released asciidoc 0.1.1. 2026-09-22 11:15:28 -07:00
John MacFarlane 2efebd659c Use released doclayout 0.6. 2026-09-21 21:44:50 -07:00
John MacFarlane 034c5f7a80 Remove outdated comment from cabal.project. 2026-09-21 21:10:31 -07:00
John MacFarlane ca9d6d446f Bump citeproc version for pandoc-lua-engine. 2026-09-21 13:35:55 -07:00
John MacFarlane 7fb60489e6 Use released citeproc 0.14. 2026-09-21 13:26:09 -07:00
John MacFarlane af38a7ebe0 Try to fix stack.yaml allow-newer-deps. 2026-09-21 12:28:12 -07:00
John MacFarlane a01d44ad71 Update all-cabal-hashes in flake.lock 2026-09-21 12:27:12 -07:00
John MacFarlane f875441b87 Add allow-newer stanza to cabal.project 2026-09-21 11:51:31 -07:00
John MacFarlane 71538013c3 Update zip-archive bound in test suite 2026-09-21 11:51:16 -07:00
John MacFarlane 2edf691fca Use allow-newer in stack.yaml to allow zip-archive 2026-09-21 11:33:31 -07:00
John MacFarlane 0bf6eb8330 Use released zip-archive 0.5. 2026-09-21 11:20:52 -07:00
John MacFarlaneandClaude 840753aac9 Shared: fuse traversals in ensureValidXmlIdentifiers.
Previously this made three full walks of the document: one for block
attributes, one for inline attributes, and one for link targets.
Fold the link-target fixing into the inline attribute walk, and
inline the now single-use walkAttr helper (not exported), reducing
this to two walks.

Ad hoc benchmark (calling ensureValidXmlIdentifiers on a parsed
8000-section document with ~500k inlines, 20 iterations, forced with
deepseq): 3.87s -> 3.17s (~18% faster).  Output is byte-identical
for markdown -> html4.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 06:01:03 +00:00
John MacFarlaneandClaude 50e596b7d7 Shared: avoid Text -> String round-trips in htmlAttrs.
Each attribute was rendered with `text . T.unpack`, converting the
escaped Text to String and back.  Use `literal . fromText` instead
(free for Doc Text, which is what all callers use).  This adds a
FromText constraint to htmlAttrs and tagWithAttrs.

Benchmark (30k-cell table with id/class/data attrs, json ->
mediawiki): 2.15s -> 2.00s with ~70-char attribute values; no change
with short values, where attribute text is a small fraction of the
document.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 05:51:17 +00:00
John MacFarlaneandClaude 7605eb4ddc Shared: make endsWithPlain look inside DefinitionList.
endsWithPlain recursed into the last item of BulletList and
OrderedList but ignored DefinitionList, so list items ending with a
compact definition list were treated as loose by the RST, Org, and
Haddock writers.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 05:45:33 +00:00
John MacFarlaneandClaude 6dc4fb1d7c Shared: recognize empty task list items in toTaskListItem.
An item like `- [ ]` with no following text parses to
`Plain [Str "☐"]` (no Space), which toTaskListItem did not match.
So such items were rendered as a literal ☐/☒ character, and a single
empty item kept the whole list from being treated as a task list
(e.g. the HTML writer's task-list class and checkbox rendering).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 05:44:11 +00:00
John MacFarlaneandClaude 5f41f88c1d Shared: drop expired entries in decrementTrailingRowSpans.
Entries whose RowSpan fell to 0 were left in the map, relying on
every consumer to guard against them.  Delete them instead, matching
what takePreviousSpansAtColumn already does.  No change in behavior
for current consumers (AsciiDoc, ANSI writers).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 05:40:59 +00:00
John MacFarlaneandClaude 38df055ea4 Fix ensureValidXmlIdentifiers for Figure and table sub-elements.
walkAttr only rewrote attributes on Header, CodeBlock, Table, and
Div, while fixLinks rewrote every internal link starting with a
non-letter.  As a result, ids on Figure, TableHead, TableBody,
TableFoot, Row, and Cell were left unchanged while links to them were
renamed, producing broken internal links in the HTML4/XHTML, EPUB,
DocBook, TEI, ICML, FB2, and ODT writers.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 05:39:24 +00:00
John MacFarlaneandClaude 8967b75e8e Docx writer: cache token-type styles instead of rebuilding per Code.
Every Code inline rebuilt an association list mapping all ~30
highlighting token types to their rStyle elements (30 style-map
lookups plus string conversions), and each highlighted token then did
a linear scan of that list.  Compute the map once at the start of
writing (it depends only on the style maps, which are fixed) and store
it in the writer state as a Data.Map.

On an ad hoc benchmark with 100K inline code spans, conversion time
drops from 2.4s to 1.5s.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 04:58:52 +00:00
John MacFarlaneandClaude 4a18221ce9 Docx writer: make convertSpace linear instead of quadratic.
convertSpace merged adjacent Str/Space inlines by repeatedly
concatenating onto the accumulated Text, so a paragraph of n words
required O(n^2) copying.  Accumulate the chunks and concatenate once
instead.

On an ad hoc benchmark (4 paragraphs of 80K words each), conversion
time drops from 3.2s to 1.1s, and time no longer depends on paragraph
length (16 x 20K words previously took 1.8s, now also 1.2s).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-21 04:58:52 +00:00
John MacFarlane 5ade1bdf72 Docx writer: properly signal error if reference docx can't be parsed. 2026-09-20 20:09:47 -07:00
John MacFarlaneandClaude 08d75338f1 LaTeX writer: avoid printf in toLabel.
Numeric.showHex produces the same lowercase hex output as printf "%x"
without the overhead of format string interpretation.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-20 18:41:15 +00:00
John MacFarlaneandClaude 51960778da LaTeX writer: only compute PDF trailer ID when SOURCE_DATE_EPOCH is set.
Previously the code relied on laziness to avoid the extra full render
of the document body used in the trailer ID hash. Make this explicit
by only computing the trailer ID when it will actually be used.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-20 18:41:15 +00:00