Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changes
=======

37.1 (2022-09-03)
-----------------

* Allow HTML5 `nav` tag through cleaner (#259)

37.0 (2022-08-21)
-----------------

Expand Down
2 changes: 1 addition & 1 deletion readme_renderer/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
__uri__ = "https://github.com/pypa/readme_renderer"

__version__ = "37.0"
__version__ = "37.1"

__author__ = "The Python Packaging Authority"
__email__ = "[email protected]"
Expand Down
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",
"tr", "tt", "kbd", "var", "input", "section", "aside", "nav",
]

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


Expand Down
22 changes: 22 additions & 0 deletions tests/fixtures/test_rst_contents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<nav class="contents" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a href="#features" id="toc-entry-1" rel="nofollow">Features</a></p></li>
<li><p><a href="#installation" id="toc-entry-2" rel="nofollow">Installation</a></p></li>
</ul>
</nav>
<section id="features">
<h2><a href="#toc-entry-1" rel="nofollow">Features</a></h2>
<ul class="simple">
<li><p>Eats cheese</p></li>
</ul>
</section>
<section id="installation">
<h2><a href="#toc-entry-2" rel="nofollow">Installation</a></h2>
<p class="section-subtitle" id="requirements">Requirements</p>
<ul class="simple">
<li><p>Teeth</p></li>
<li><p>Good taste</p></li>
</ul>
<p>Let’s eat some cheese together!</p>
</section>
19 changes: 19 additions & 0 deletions tests/fixtures/test_rst_contents.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. Tests that using a Table of Contents directive renders correctly

.. contents::

Features
========

* Eats cheese

Installation
============

Requirements
------------

* Teeth
* Good taste

Let's eat some cheese together!