diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-08-11 20:31:17 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-08-12 13:50:18 +0200 |
commit | e1e1baa1bd33181b32c58524bc21ef21da4880db (patch) | |
tree | 6840eb247068ee425e8e6955677b90c70b22e3d2 /internal/warpc/wasm/renderkatex.wasm | |
parent | e42263529c35d966b752690ad1bcb461b90b470d (diff) | |
download | hugo-e1e1baa1bd33181b32c58524bc21ef21da4880db.tar.gz hugo-e1e1baa1bd33181b32c58524bc21ef21da4880db.zip |
Improve Katex error handling and fix handling of large expressions
* Make throwOnError=true the new default
* Handle JS errors as part of the RPC request/response flow
* Return a new Result type with .Err on it
This enables constructs on the form:
```handlebars
{{ with transform.ToMath "c = \\foo{a^2 + b^2}" }}
{{ with .Err }}
{{ warnf "error: %s" . }}
{{ else }}
{{ . }}
{{ end }}
{{ end }}
```
Note that the new `Result` type behaves like `template.HTML` (or a string if needed) when printed, but it will panic if in a error state.
Closes #12748
Diffstat (limited to 'internal/warpc/wasm/renderkatex.wasm')
-rw-r--r-- | internal/warpc/wasm/renderkatex.wasm | bin | 472126 -> 472553 bytes |
1 files changed, 0 insertions, 0 deletions
diff --git a/internal/warpc/wasm/renderkatex.wasm b/internal/warpc/wasm/renderkatex.wasm Binary files differindex c2b004d75..0afa10852 100644 --- a/internal/warpc/wasm/renderkatex.wasm +++ b/internal/warpc/wasm/renderkatex.wasm |