From d0505fff262449818bfac612f150d9f45ea56331 Mon Sep 17 00:00:00 2001 From: Xabier Vidales Date: Thu, 21 Nov 2024 13:08:49 +0100 Subject: [PATCH 1/3] Add typst in default text escapers --- askama_derive/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askama_derive/src/config.rs b/askama_derive/src/config.rs index 19358371..88c90ce1 100644 --- a/askama_derive/src/config.rs +++ b/askama_derive/src/config.rs @@ -305,7 +305,7 @@ static CONFIG_FILE_NAME: &str = "askama.toml"; static DEFAULT_SYNTAX_NAME: &str = "default"; static DEFAULT_ESCAPERS: &[(&[&str], &str)] = &[ (&["html", "htm", "svg", "xml"], "::Html"), - (&["md", "none", "txt", "yml", ""], "::Text"), + (&["md", "none", "txt", "yml", "typ", ""], "::Text"), (&["j2", "jinja", "jinja2"], "::Html"), ]; From 7597ee122076294bd611bbe6f3c1a78d9c532351 Mon Sep 17 00:00:00 2001 From: Xabier Vidales Date: Thu, 21 Nov 2024 14:04:13 +0100 Subject: [PATCH 2/3] test: fix escape_modes --- askama_derive/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askama_derive/src/config.rs b/askama_derive/src/config.rs index 88c90ce1..ce8cff07 100644 --- a/askama_derive/src/config.rs +++ b/askama_derive/src/config.rs @@ -574,7 +574,7 @@ mod tests { "::askama::Html".into() ), ( - str_set(&["md", "none", "txt", "yml", ""]), + str_set(&["md", "none", "txt", "yml", "typ", ""]), "::askama::Text".into() ), (str_set(&["j2", "jinja", "jinja2"]), "::askama::Html".into()), From 3f507006f1ae2aa62d60da0c629f95e132be1d6a Mon Sep 17 00:00:00 2001 From: Xabier Vidales Date: Thu, 21 Nov 2024 16:33:37 +0100 Subject: [PATCH 3/3] style: sort extensions alphabetically --- askama_derive/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/askama_derive/src/config.rs b/askama_derive/src/config.rs index ce8cff07..aac8123a 100644 --- a/askama_derive/src/config.rs +++ b/askama_derive/src/config.rs @@ -305,7 +305,7 @@ static CONFIG_FILE_NAME: &str = "askama.toml"; static DEFAULT_SYNTAX_NAME: &str = "default"; static DEFAULT_ESCAPERS: &[(&[&str], &str)] = &[ (&["html", "htm", "svg", "xml"], "::Html"), - (&["md", "none", "txt", "yml", "typ", ""], "::Text"), + (&["md", "none", "txt", "typ", "yml", ""], "::Text"), (&["j2", "jinja", "jinja2"], "::Html"), ]; @@ -574,7 +574,7 @@ mod tests { "::askama::Html".into() ), ( - str_set(&["md", "none", "txt", "yml", "typ", ""]), + str_set(&["md", "none", "txt", "typ", "yml", ""]), "::askama::Text".into() ), (str_set(&["j2", "jinja", "jinja2"]), "::askama::Html".into()),