mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Add katex option ThrowOnError
As an internal option for now. Katex misbehaves in error situations without a value set.
This commit is contained in:
parent
891aa00fe1
commit
e42263529c
2 changed files with 7 additions and 0 deletions
|
@ -37,6 +37,10 @@ type KatexOptions struct {
|
|||
|
||||
// Specifies a minimum thickness, in ems, for fraction lines.
|
||||
MinRuleThickness float64 `json:"minRuleThickness"`
|
||||
|
||||
// If true, KaTeX will throw a ParseError when it encounters an unsupported command.
|
||||
// For internal use only, for now.
|
||||
ThrowOnError bool `json:"throwOnError"`
|
||||
}
|
||||
|
||||
type KatexOutput struct {
|
||||
|
|
|
@ -223,6 +223,9 @@ func (ns *Namespace) ToMath(ctx context.Context, args ...any) (template.HTML, er
|
|||
}
|
||||
}
|
||||
|
||||
// Make sure this isn't set by the client (for now).
|
||||
katexInput.Options.ThrowOnError = false
|
||||
|
||||
s := hashing.HashString(args...)
|
||||
key := "tomath/" + s[:2] + "/" + s[2:]
|
||||
fileCache := ns.deps.ResourceSpec.FileCaches.MiscCache()
|
||||
|
|
Loading…
Reference in a new issue