From ecb2877ede56157c7e1cc4b34f5248add478b871 Mon Sep 17 00:00:00 2001 From: Julian Tescher Date: Mon, 14 Oct 2019 21:38:58 -0700 Subject: [PATCH] Allow rowspan and colspan in markdown table rendering --- src/render.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/render.rs b/src/render.rs index e0ffb569a24..dfa98b51180 100644 --- a/src/render.rs +++ b/src/render.rs @@ -67,6 +67,8 @@ impl<'a> MarkdownRenderer<'a> { ("a", hashset(&["href", "id", "target"])), ("img", hashset(&["width", "height", "src", "alt", "align"])), ("input", hashset(&["checked", "disabled", "type"])), + ("th", hashset(&["rowspan", "colspan"])), + ("td", hashset(&["rowspan", "colspan"])), ]); let allowed_classes = hashmap(&[( "code", @@ -455,4 +457,14 @@ mod tests { "

My crate

\n

Hello, world!

\n" ); } + + #[test] + fn tables_with_rowspan_and_colspan() { + let text = "
Target
\n"; + let result = markdown_to_html(text, None); + assert_eq!( + result, + "
Target
\n" + ); + } }