Skip to content

Commit

Permalink
fix: allow HTML5 figure tag through cleaner (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman authored Oct 31, 2022
1 parent 34e27d3 commit 665d550
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion readme_renderer/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"br", "caption", "cite", "col", "colgroup", "dd", "del", "details", "div",
"dl", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "p", "pre",
"span", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead",
"tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "s",
"tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "s", "figure",
]

ALLOWED_ATTRIBUTES = {
Expand Down Expand Up @@ -64,6 +64,7 @@
"dt": ["class"],
"ul": ["class"],
"nav": ["class"],
"figure": ["class"],
}


Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/test_rst_figure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<figure class="align-center">
<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">
</figure>
2 changes: 2 additions & 0 deletions tests/fixtures/test_rst_figure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. figure:: https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png
:align: center

0 comments on commit 665d550

Please sign in to comment.