From 06660eb45103177cea4416116e1434a7e1ce0a78 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 14 Feb 2021 12:59:00 +0100 Subject: [PATCH] readme: Allow `align` attributes --- src/render.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/render.rs b/src/render.rs index 7263faa3840..e93cd595bec 100644 --- a/src/render.rs +++ b/src/render.rs @@ -49,6 +49,7 @@ impl<'a> MarkdownRenderer<'a> { html_sanitizer .add_tags(&["input"]) .link_rel(Some("nofollow noopener noreferrer")) + .add_generic_attributes(&["align"]) .add_tag_attributes("a", &["id", "target"]) .add_tag_attributes("input", &["checked", "disabled", "type"]) .allowed_classes(allowed_classes) @@ -510,4 +511,14 @@ mod tests { "
Target
\n" ); } + + #[test] + fn text_alignment() { + let text = "

foo-bar

\n
Hello World!
\n"; + let result = markdown_to_html(text, None); + assert_eq!( + result, + "

foo-bar

\n
Hello World!
\n" + ); + } }