markdown: allow cell alignment in tables

Mistletoe supports Github's tables extension, including cell alignment
(see [1]). However, the sanitizer currently does not allow the align
attributes on the table cells, so the alignment never renders.

Add the align attribute to the list of allowed attributes for td and th
element, so that cell alignment works as expected.

[1] https://github.github.com/gfm/#example-199
This commit is contained in:
Conrad Hoffmann 2024-01-03 22:45:38 +01:00 committed by Drew DeVault
parent b663dbe7cf
commit 7fc2c6ca49
1 changed files with 2 additions and 0 deletions

View File

@ -180,6 +180,8 @@ _sanitizer_attrs = {
"h4": ["id"],
"h5": ["id"],
"h6": ["id"],
"th": ["align"],
"td": ["align"],
"img": _img_filter,
"input": _input_filter,
"div": _div_filter,