File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ impl<'a> MarkdownRenderer<'a> {
49
49
html_sanitizer
50
50
. add_tags ( & [ "input" ] )
51
51
. link_rel ( Some ( "nofollow noopener noreferrer" ) )
52
+ . add_generic_attributes ( & [ "align" ] )
52
53
. add_tag_attributes ( "a" , & [ "id" , "target" ] )
53
54
. add_tag_attributes ( "input" , & [ "checked" , "disabled" , "type" ] )
54
55
. allowed_classes ( allowed_classes)
@@ -510,4 +511,14 @@ mod tests {
510
511
"<table><tbody><tr><th rowspan=\" 1\" colspan=\" 2\" >Target</th></tr></tbody></table>\n "
511
512
) ;
512
513
}
514
+
515
+ #[ test]
516
+ fn text_alignment ( ) {
517
+ let text = "<h1 align=\" center\" >foo-bar</h1>\n <h5 align=\" center\" >Hello World!</h5>\n " ;
518
+ let result = markdown_to_html ( text, None ) ;
519
+ assert_eq ! (
520
+ result,
521
+ "<h1 align=\" center\" >foo-bar</h1>\n <h5 align=\" center\" >Hello World!</h5>\n "
522
+ ) ;
523
+ }
513
524
}
You can’t perform that action at this time.
0 commit comments