Merge pull request #321 from Kijewski/pr-ext-askama

derive: add ".askama" to list of HTML extensions
This commit is contained in:
Guillaume Gomez 2025-01-25 23:29:14 +01:00 committed by GitHub
commit 836046a8c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -369,7 +369,7 @@ static DEFAULT_SYNTAX_NAME: &str = "default";
static DEFAULT_ESCAPERS: &[(&[&str], &str)] = &[
(
&[
"html", "htm", "j2", "jinja", "jinja2", "rinja", "svg", "xml",
"askama", "html", "htm", "j2", "jinja", "jinja2", "rinja", "svg", "xml",
],
"Html",
),
@ -649,7 +649,7 @@ mod tests {
(str_set(&["js"]), "::my_filters::Js".into()),
(
str_set(&[
"html", "htm", "j2", "jinja", "jinja2", "rinja", "svg", "xml"
"askama", "html", "htm", "j2", "jinja", "jinja2", "rinja", "svg", "xml"
]),
"rinja::filters::Html".into()
),

View File

@ -865,7 +865,7 @@ const _: () = {
};
#[cfg(feature = "code-in-doc")]
const JINJA_EXTENSIONS: &[&str] = &["j2", "jinja", "jinja2", "rinja"];
const JINJA_EXTENSIONS: &[&str] = &["askama", "j2", "jinja", "jinja2", "rinja"];
#[test]
fn get_source() {

View File

@ -1,4 +1,4 @@
error: invalid escaper 'latex' for `escape` filter. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "rinja", "svg", "txt", "xml", "yml"
error: invalid escaper 'latex' for `escape` filter. The available extensions are: "", "askama", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "rinja", "svg", "txt", "xml", "yml"
--> LocalEscaper.html:1:38
"text|escape(\"latex\")}}`."
--> tests/ui/no-such-escaper.rs:6:14
@ -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'. 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"
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: "", "askama", "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'. 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"
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: "", "askama", "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")]