mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-30 14:31:36 +00:00
Improve error message when an extension escaper is missing
This commit is contained in:
parent
41425e15aa
commit
b0d834c0fd
@ -99,7 +99,8 @@ impl TemplateInput<'_> {
|
||||
.ok_or_else(|| {
|
||||
CompileError::no_file_info(
|
||||
format!(
|
||||
"no escaper defined for extension '{escaping}'. {}",
|
||||
"no escaper defined for extension '{escaping}'. You can define an escaper \
|
||||
in the config file (named `rinja.toml` by default). {}",
|
||||
MsgValidEscapers(&config.escapers),
|
||||
),
|
||||
*ext_span,
|
||||
|
@ -6,13 +6,13 @@ error: invalid escaper 'latex' for `escape` filter. The available extensions are
|
||||
6 | source = r#"In LaTeX you write `{{text}}` like `{{text|escape("latex")}}`."#,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: no escaper defined for extension 'tex'. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "rinja", "svg", "txt", "xml", "yml"
|
||||
error: no escaper defined for extension 'tex'. You can define an escaper in the config file (named `rinja.toml` by default). The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "rinja", "svg", "txt", "xml", "yml"
|
||||
--> tests/ui/no-such-escaper.rs:14:11
|
||||
|
|
||||
14 | ext = "tex",
|
||||
| ^^^^^
|
||||
|
||||
error: no escaper defined for extension 'tex'. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "rinja", "svg", "txt", "xml", "yml"
|
||||
error: no escaper defined for extension 'tex'. You can define an escaper in the config file (named `rinja.toml` by default). The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "rinja", "svg", "txt", "xml", "yml"
|
||||
--> tests/ui/no-such-escaper.rs:22:19
|
||||
|
|
||||
22 | #[template(path = "latex-file.tex")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user