hugo/internal/warpc
Bjørn Erik Pedersen e1e1baa1bd 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
2024-08-12 13:50:18 +02:00
..
gen Add build time math rendering 2024-08-09 17:18:37 +02:00
js Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
wasm Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
build.sh Add build time math rendering 2024-08-09 17:18:37 +02:00
katex.go Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
warpc.go Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
warpc_test.go Add build time math rendering 2024-08-09 17:18:37 +02:00
watchtestscripts.sh Add build time math rendering 2024-08-09 17:18:37 +02:00