Skip to content

Commit 665d550

Browse files
authored
fix: allow HTML5 figure tag through cleaner (#265)
1 parent 34e27d3 commit 665d550

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

readme_renderer/clean.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"br", "caption", "cite", "col", "colgroup", "dd", "del", "details", "div",
3131
"dl", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "p", "pre",
3232
"span", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead",
33-
"tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "s",
33+
"tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "s", "figure",
3434
]
3535

3636
ALLOWED_ATTRIBUTES = {
@@ -64,6 +64,7 @@
6464
"dt": ["class"],
6565
"ul": ["class"],
6666
"nav": ["class"],
67+
"figure": ["class"],
6768
}
6869

6970

tests/fixtures/test_rst_figure.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<figure class="align-center">
2+
<img alt="https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png" src="https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png">
3+
</figure>

tests/fixtures/test_rst_figure.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. figure:: https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png
2+
:align: center

0 commit comments

Comments
 (0)