Repository: pypa/readme_renderer (language: python)

Issue:
Allow figcaption through clean.py
Docutils generates a figcaption tag for image captions that isn’t being recognized yet and displays raw html.
Example: https://pypi.org/project/sphinxcontrib-mermaid/
```[tasklist]
### Tasks
- [x] Add a test case for RST that implement an image with a caption
- [x] Add figcaption tag to allowed tags
```

add figcaption to allowed tags
fix #285

Hi,  
this pull requests adds the `figcaption` tag to the list of allowed tags.
I also added the missing `long_description_content_type` to the setup.py file as tox warned me about this.
Regards,  
Adrian


Discussion / hints:

Hi @AdrianDsg !

Thanks for the contribution.

As noted in the originating issue, we try add tests to confirm the new behaviors as we add them - can you please add a new test that confirms this behavior?

Also, as the lint fails, you may need to reflow some of the lines to accommodate the new directives.

Fix patch:
diff --git a/readme_renderer/clean.py b/readme_renderer/clean.py
index f610954..29324d3 100644
--- a/readme_renderer/clean.py
+++ b/readme_renderer/clean.py
@@ -31,6 +31,7 @@
     "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", "figure",
+    "figcaption",
 ]
 
 ALLOWED_ATTRIBUTES = {


Test patch:
diff --git a/tests/fixtures/test_rst_figure.html b/tests/fixtures/test_rst_figure.html
index 0975d30..808a1e3 100644
--- a/tests/fixtures/test_rst_figure.html
+++ b/tests/fixtures/test_rst_figure.html
@@ -1,3 +1,6 @@
 <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">
+<figcaption>
+<p>This is the caption for the figure</p>
+</figcaption>
 </figure>
diff --git a/tests/fixtures/test_rst_figure.rst b/tests/fixtures/test_rst_figure.rst
index 648f161..bfa3550 100644
--- a/tests/fixtures/test_rst_figure.rst
+++ b/tests/fixtures/test_rst_figure.rst
@@ -1,2 +1,4 @@
 .. figure:: https://raw.githubusercontent.com/schlatterbeck/plot-antenna/master/test/12-el-azimuth.png
     :align: center
+
+    This is the caption for the figure
\ No newline at end of file