When calling `fetchItem` in `getTemplate`, we temporarily
reset the `stSourceURL` in CommonState so that the template
is sought locally. Previously, an exception in `fetchItem`
would prevent `stSourceURL` from being set back to its original
value. This could result in a local file being fetched instead
of a remote one. Note that an exception is triggered when one
uses e.g. `--template default.html5`; in that case `getTemplate`
handles the exception by looking for the file in the user
data directory.
This patch fixes the bug so that the `stSourceURL` is reset
regardless of whether `fetchItem` raises an exception.
Thanks to Yingjie Su for identifying the problem.
This replaces (now deprecated but still functional) options
`--mathml`, `--mathjax`, `--gladtex`, `--katex`, `--webtex`.
The `plain` style can now be specified explicitly.
In defaults files, `html-math-method` is now
`math-method` (though `html-math-method` will still work).
Text.Pandoc.App.Opt:
- In unexported type CompletionKind, add MathMethods.
- In Opt, change `optHTMLMathMethod` to `optMathMethod`. [API change]
Text.Pandoc.Options:
- Rename HTMLMathMethod type to MathMethod. [API change]
- Rename `writerHTMLMathMethod` field of WriterOptions to
`writerMathMethod`. [API change]
Text.Pandoc.App.Completion:
- Clean up code.
- Add support for `--math-method`.
RTL is now properly handled in these cases:
- `dir: rtl` (or `ltr`) in document metadata
- an RTL `lang` in metadata (e.g. `he`, `ar`), unless overridden
by `dir`
- a `dir` attribute on a Div
The OpenDocument writer tracks the active writing mode and, when it
is RTL, emits automatic paragraph styles with
`style:writing-mode="rl-tb"` derived from the usual named styles
(deduplicated per parent style). `fo:text-align` is also used
to get the matching text alignment.
Code blocks remain ltr regardless.
Closes#11301.
With some help from Claude Fable.
In 3.8, we added DefaultHighlighting as a HighlightStyle.
However, not all writers were updated to match on it, with
the result that we have lost highlighting in Ms, ConTeXt,
ODT, and OpenDocument.
(This was compounded by a bug in the change that was made
to the ConTeXt writer at the time.)
This commit fixes these things.
Closes#11829.
Co-authored by Claude Fable 5.
* Add FindRelatedProducts action to Install buttons
* Disabled the preliminary FindRelatedProducts until the install mode is set
Previously, registry records of previous versions were not being removed.
Closes#11825.
This ensures that setting `lang` will affect the whole document.
Previously, setting `lang` to `he` was not sufficient to make
the document RTL.
See #11301.
Make `--bash-completion` an alias of `--completion=bash`.
Reorganize option parsing code using a new data structure OptionSpec,
which can encode the type of completion needed by each option.
Add new unexported module Text.Pandoc.Completion.
Unexported module Text.Pandoc.CommandLineOptions: export OptionSpec.
Closes#8542.
See 185c29b4b2 which claims that
`block` can occur in inline contexts. I can no longer confirm
this and suspect that it may have been an unintended behavior
of earlier versions of typst, now fixed.
Closes#11814.
* epub.css: add optional dark-mode (light-dark) support
The default EPUB stylesheet hardcodes a single dark text color
(#1a1a1a) on top of the reading system's own background. This wraps
that color — and the <hr> rule and table borders that use it — with
CSS light-dark(), so readers supporting `color-scheme` get an
inverted dark theme.
Each light-dark() declaration is preceded by a plain #1a1a1a
fallback, so readers that do not support light-dark() simply drop
the new declaration and keep the unchanged original appearance
(graceful degradation). No change to pandoc's conversion logic.
Align dark-mode values with bundled breezedark palette
If this attribute is set, the writer will output a label.
(This overrides labels based on identifiers, when identifiers
are present.)
Note that labels in typst need not be unique and may be used to
style elements using show rules. For example, one can attach
an `excerpt` label to all Divs that are excerpts, and style this
using a show rule like `#show <excerpt>: set text(blue)`.
See discussion at #11794.
This reverts commit 49853607e6.
The option `-wasm-use-legacy-eh=false` does not seem to be
recognized in the version of the compiler we are now using.
Reopens#11787.