When parsing an inline note (`^[...]`) inside a quoted span,
`stateQuoteContext` was still set to `InSingleQuote`/`InDoubleQuote`,
so quotes within notes failed to parse as `Quoted` nodes.
Fix this by wrapping the note body parser in
`withQuoteContext NoQuote`.
Closes#11613.
Styles unconditionally emits css that uses screen-only properties.
Paged-media engines (weasyprint, prince, pagedjs) have no viewport
and issue warnings. Fix it to hide these properties from the engines.
Closes#11524.
This allows one to pass parameters to typst, which are available
at `sys.inputs`, just as `typst` itself does with its `--input`
option.
[API changes]
* ReaderOptions has a new field `readerTypstInputs`.
* Opt has a new field `optTypstInputs`.
Closes#11588.
Auto-inject embed_images filter for PDF via Typst. Otherwise
conversion fails because we can't write the images in a temporary
directory in the WASM sandbox. See jgm/pandoc#11584.
...as the key for item data, if it is defined. The `id` key used
by Zotero is not exposed by their API and is generally not what
is wanted when converting to biblatex.
Closes#11581. Cf. #10366, #11567.
Map fr-CA to "french" instead of deprecated "canadien".
The babel-french package's `canadien.ldf` is deprecated and broken:
it never calls `\ldf@finish`, so `\bbl@main@language` is left undefined,
causing babel to crash at `\begin{document}`. Since `canadien` was always
just an unconditional alias for `french`, use `french` directly.
Closes#11575.
When a heading contained a footnote, processing the footnote's block
content would consume the stFirstPara flag, causing the following
paragraph to incorrectly receive BodyText style instead of
FirstParagraph. Fix by saving and restoring stFirstPara around
footnote block processing.
Closes#11573.
Co-Authored-By: Claude <noreply@anthropic.com>
Use M.toList to iterate over defined notes with both key and
value, instead of M.keys followed by redundant M.lookup for
each key. This also removes the unreachable Nothing branch
(a key obtained from M.keys is always present in the map).
Co-Authored-By: Claude <noreply@anthropic.com>
Pack the concatenated String once instead of packing each
segment individually with map T.pack and then mconcat-ing
the resulting Texts.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace the String-based reverse-accumulate-then-pack approach
with a Text.Lazy.Builder that appends characters as they are
parsed. A Bool flag tracks whether the previous character was a
backslash, replacing the pattern match on the reversed String
accumulator.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace 'length ls > ln' (which traverses the entire line list)
and 'ls !! (ln - 1)' (another traversal) with a single
'drop (ln - 1) ls' and pattern match. This is O(ln) instead
of O(length ls).
Co-Authored-By: Claude <noreply@anthropic.com>
Pack the concatenated String once instead of packing each
segment individually with map T.pack and then mconcat-ing the
resulting Texts.
Co-Authored-By: Claude <noreply@anthropic.com>
Build the result via Text.Lazy.Builder instead of constructing
an intermediate String with (:) and then packing it.
Co-Authored-By: Claude <noreply@anthropic.com>
Use T.singleton and Text concatenation instead of building
a Char list with [l] ++ chunk ++ [r] and packing it.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace per-character linear scan via T.any with O(log n)
Set.member lookup against a pre-computed top-level Set.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace `TB.fromText mempty` with `mempty`; converting an empty
Text to a Builder is a no-op, and `mempty` is clearer.
Co-Authored-By: Claude <noreply@anthropic.com>
The filter predicate `k /= "id" || k /= "class"` is a tautology:
for any key, at least one of the two disjuncts is true, so no
key-value pairs were ever removed. Use && so that both "id" and
"class" entries are properly stripped from kvs.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace the String-based splitAt' with a Text-native
splitAtWidth that computes the character index for a given
display width, then uses T.splitAt directly. This avoids
unpacking the entire Text to [Char] and repacking each piece.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace linear 'elem' search with 'Set.member' lookup and
pre-compute the tag sets outside the per-tag callback.
Co-Authored-By: Claude <noreply@anthropic.com>
Replace list comprehension filters (which materialize the full
list) with 'any isPara', allowing early exit on the first match.
Co-Authored-By: Claude <noreply@anthropic.com>