hugo/tpl/internal/go_templates/htmltemplate
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 deps: Update to Chroma v0.8.2 2020-11-20 09:30:05 +01:00
attr.go tpl: Sync go_templates for Go 1.18 2022-03-16 08:54:25 +01:00
attr_string.go Go 1.21 Upgrade 2023-08-23 21:49:27 +02:00
clone_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
content.go Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
content_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
context.go Pull in the latest code from Go's template packages (#11771) 2023-12-04 12:07:54 +01:00
css.go Fix upstream Go templates bug with reversed key/value assignment 2023-06-15 23:04:33 +02:00
css_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
delim_string.go Go 1.21 Upgrade 2023-08-23 21:49:27 +02:00
doc.go Go 1.21 Upgrade 2023-08-23 21:49:27 +02:00
element_string.go Go 1.21 Upgrade 2023-08-23 21:49:27 +02:00
error.go Pull in the latest code from Go's template packages (#11771) 2023-12-04 12:07:54 +01:00
escape.go Pull in the latest code from Go's template packages (#11771) 2023-12-04 12:07:54 +01:00
escape_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
example_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
examplefiles_test.go tpl: Sync go_templates for Go 1.18 2022-03-16 08:54:25 +01:00
exec_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
html.go Fix upstream Go templates bug with reversed key/value assignment 2023-06-15 23:04:33 +02:00
html_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
hugo_template.go Improve Katex error handling and fix handling of large expressions 2024-08-12 13:50:18 +02:00
js.go Upgrade to Go 1.22.1 2024-03-15 16:40:36 +01:00
js_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
jsctx_string.go Fix upstream Go templates bug with reversed key/value assignment 2023-06-15 23:04:33 +02:00
multi_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
state_string.go Pull in the latest code from Go's template packages (#11771) 2023-12-04 12:07:54 +01:00
template.go tpl/internal: Sync go_templates 2022-11-14 22:31:50 +01:00
template_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
transition.go Pull in the latest code from Go's template packages (#11771) 2023-12-04 12:07:54 +01:00
transition_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
url.go tpl/internal: Sync go_templates 2022-11-14 22:31:50 +01:00
url_test.go Bump to go 1.21 in go.mod 2024-08-01 12:07:27 +02:00
urlpart_string.go Go 1.21 Upgrade 2023-08-23 21:49:27 +02:00