mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 07:20:55 +00:00
Merge pull request #247 from GuillaumeGomez/improve-error-message
Improve error message when an extension escaper is missing
This commit is contained in:
commit
afc0de1700
@ -99,7 +99,8 @@ impl TemplateInput<'_> {
|
|||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
CompileError::no_file_info(
|
CompileError::no_file_info(
|
||||||
format!(
|
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),
|
MsgValidEscapers(&config.escapers),
|
||||||
),
|
),
|
||||||
*ext_span,
|
*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")}}`."#,
|
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
|
--> tests/ui/no-such-escaper.rs:14:11
|
||||||
|
|
|
|
||||||
14 | ext = "tex",
|
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
|
--> tests/ui/no-such-escaper.rs:22:19
|
||||||
|
|
|
|
||||||
22 | #[template(path = "latex-file.tex")]
|
22 | #[template(path = "latex-file.tex")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user