Repository: djc/askama
Pull request #817 (2023-05-19 14:04:13)

Upgrade to comrak 0.18


Patch:
diff --git a/askama/Cargo.toml b/askama/Cargo.toml
index 95554da..f70902b 100644
--- a/askama/Cargo.toml
+++ b/askama/Cargo.toml
@@ -41,7 +41,7 @@ mime_guess = []
 [dependencies]
 askama_derive = { version = "0.12.0", path = "../askama_derive" }
 askama_escape = { version = "0.10.3", path = "../askama_escape" }
-comrak = { version = "0.17", optional = true, default-features = false }
+comrak = { version = "0.18", optional = true, default-features = false }
 dep_humansize = { package = "humansize", version = "2", optional = true }
 dep_num_traits = { package = "num-traits", version = "0.2.6", optional = true }
 percent-encoding = { version = "2.1.0", optional = true }
diff --git a/askama/src/filters/mod.rs b/askama/src/filters/mod.rs
index 642641a..a7aa62b 100644
--- a/askama/src/filters/mod.rs
+++ b/askama/src/filters/mod.rs
@@ -385,6 +385,7 @@ where
             width: 0,
             unsafe_: false,
             list_style: ListStyleType::Dash,
+            sourcepos: false,
         },
     };
 
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 05b3fc3..cdf5ebf 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -532,18 +532,27 @@ impl<'a> Generator<'a> {
     // Implement Rocket's `Responder`.
     #[cfg(feature = "with-rocket")]
     fn impl_rocket_responder(&mut self, buf: &mut Buffer) -> Result<(), CompileError> {
-        let lifetime = syn::Lifetime::new("'askama", proc_macro2::Span::call_site());
-        let param = syn::GenericParam::Lifetime(syn::LifetimeParam::new(lifetime));
+        let lifetime1 = syn::Lifetime::new("'askama1", proc_macro2::Span::call_site());
+        let lifetime2 = syn::Lifetime::new("'askama2", proc_macro2::Span::call_site());
+
+        let mut param2 = syn::LifetimeParam::new(lifetime2);
+        param2.colon_token = Some(syn::Token![:](proc_macro2::Span::call_site()));
+        param2.bounds = syn::punctuated::Punctuated::new();
+        param2.bounds.push_value(lifetime1.clone());
+
+        let param1 = syn::GenericParam::Lifetime(syn::LifetimeParam::new(lifetime1));
+        let param2 = syn::GenericParam::Lifetime(param2);
+
         self.write_header(
             buf,
-            "::askama_rocket::Responder<'askama, 'askama>",
-            Some(vec![param]),
+            "::askama_rocket::Responder<'askama1, 'askama2>",
+            Some(vec![param1, param2]),
         )?;
 
         buf.writeln("#[inline]")?;
         buf.writeln(
-            "fn respond_to(self, _: &::askama_rocket::Request) \
-             -> ::askama_rocket::Result<'askama> {",
+            "fn respond_to(self, _: &'askama1 ::askama_rocket::Request) \
+             -> ::askama_rocket::Result<'askama2> {",
         )?;
         buf.writeln("::askama_rocket::respond(&self)")?;
 
diff --git a/askama_rocket/Cargo.toml b/askama_rocket/Cargo.toml
index e15724b..e9f5afe 100644
--- a/askama_rocket/Cargo.toml
+++ b/askama_rocket/Cargo.toml
@@ -15,7 +15,7 @@ rust-version = "1.58"
 
 [dependencies]
 askama = { version = "0.12", path = "../askama", default-features = false, features = ["with-rocket", "mime", "mime_guess"] }
-rocket = { version = "0.5.0-rc.2", default-features = false }
+rocket = { version = "0.5.0-rc.3", default-features = false }
 
 [dev-dependencies]
 futures-lite = "1.12.0"


Test patch:
diff --git a/askama_rocket/tests/basic.rs b/askama_rocket/tests/basic.rs
index a61c188..1ded705 100644
--- a/askama_rocket/tests/basic.rs
+++ b/askama_rocket/tests/basic.rs
@@ -3,6 +3,7 @@ use askama::Template;
 use futures_lite::future::block_on;
 use rocket::http::{ContentType, Status};
 use rocket::local::asynchronous::Client;
+use rocket::Responder;
 
 #[derive(Template)]
 #[template(path = "hello.html")]
@@ -10,6 +11,11 @@ struct HelloTemplate<'a> {
     name: &'a str,
 }
 
+#[derive(Responder)]
+struct HelloResponder<'a> {
+    template: HelloTemplate<'a>,
+}
+
 #[rocket::get("/")]
 fn hello() -> HelloTemplate<'static> {
     HelloTemplate { name: "world" }
diff --git a/testing/Cargo.toml b/testing/Cargo.toml
index 6e973a4..c1d5ecc 100644
--- a/testing/Cargo.toml
+++ b/testing/Cargo.toml
@@ -14,7 +14,7 @@ markdown = ["comrak", "askama/markdown"]
 
 [dependencies]
 askama = { path = "../askama", version = "0.12" }
-comrak = { version = "0.17", default-features = false, optional = true }
+comrak = { version = "0.18", default-features = false, optional = true }
 serde_json = { version = "1.0", optional = true }
 
 [dev-dependencies]