diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-10-04 09:33:44 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-11-30 13:33:06 +0100 |
commit | 69e2db6efadf2d15514a8947f48acaf174024a57 (patch) | |
tree | f965676406b931a7b767e8bc5f978af50f624178 /testing | |
parent | 21f840a2ad03b23fc9d54f581323b30a3cc9b620 (diff) | |
download | askama-69e2db6efadf2d15514a8947f48acaf174024a57.tar.gz askama-69e2db6efadf2d15514a8947f48acaf174024a57.tar.bz2 askama-69e2db6efadf2d15514a8947f48acaf174024a57.zip |
Upgrade to comrak 0.19
Diffstat (limited to 'testing')
-rw-r--r-- | testing/Cargo.toml | 2 | ||||
-rw-r--r-- | testing/tests/markdown.rs | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/testing/Cargo.toml b/testing/Cargo.toml index 23b5743..1d7050d 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.18", default-features = false, optional = true } +comrak = { version = "0.19", default-features = false, optional = true } serde_json = { version = "1.0", optional = true } [dev-dependencies] diff --git a/testing/tests/markdown.rs b/testing/tests/markdown.rs index e0150f6..75163c9 100644 --- a/testing/tests/markdown.rs +++ b/testing/tests/markdown.rs @@ -1,7 +1,7 @@ #![cfg(feature = "markdown")] use askama::Template; -use comrak::{ComrakOptions, ComrakRenderOptions}; +use comrak::Options; #[derive(Template)] #[template(source = "{{before}}{{content|markdown}}{{after}}", ext = "html")] @@ -42,22 +42,19 @@ struct MarkdownWithOptionsTemplate<'a> { before: &'a str, after: &'a str, content: &'a str, - options: &'a ComrakOptions, + options: &'a Options, } #[test] fn test_markdown_with_options() { + let mut options = Options::default(); + options.render.unsafe_ = true; + let s = MarkdownWithOptionsTemplate { before: "before", after: "after", content: "* 1\n* <script>alert('Lol, hacked!')</script>\n* 3", - options: &ComrakOptions { - render: ComrakRenderOptions { - unsafe_: true, - ..Default::default() - }, - ..Default::default() - }, + options: &options, }; assert_eq!( s.render().unwrap(), |