hugo/tpl/transform
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
..
testdata Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
init.go tpl/transform: Add transform.XMLEscape template function 2023-11-27 10:52:33 +01:00
remarshal.go all: Run gofumpt -l -w . 2024-01-28 23:14:09 +01:00
remarshal_test.go deps: Update github.com/pelletier/go-toml/v2 v2.0.2 => v2.0.4 2022-08-26 18:30:46 +02:00
transform.go Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
transform_integration_test.go Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
transform_test.go tpl/transform: Make Plainify and ToMath return template.HTML 2024-08-11 15:16:16 +02:00
unmarshal.go Add build time math rendering 2024-08-09 17:18:37 +02:00
unmarshal_test.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00