Skip to content

Commit

Permalink
Allow <caption> (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
twm authored and theacodes committed May 28, 2018
1 parent 9d0f438 commit 0e1c2a3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
8 changes: 4 additions & 4 deletions readme_renderer/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"strong", "ul",

# Custom Additions
"br", "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",
"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",
]

ALLOWED_ATTRIBUTES = {
Expand Down
50 changes: 50 additions & 0 deletions tests/fixtures/test_rst_caption.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<table>
<caption>Multiplication</caption>
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead>
<tr><th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
</tr>
</thead>
<tbody>
<tr><td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr><td>2</td>
<td>4</td>
<td>6</td>
<td>8</td>
<td>10</td>
</tr>
<tr><td>3</td>
<td>6</td>
<td>9</td>
<td>12</td>
<td>15</td>
</tr>
<tr><td>4</td>
<td>8</td>
<td>12</td>
<td>16</td>
<td>20</td>
</tr>
<tr><td>5</td>
<td>10</td>
<td>15</td>
<td>20</td>
<td>25</td>
</tr>
</tbody>
</table>
10 changes: 10 additions & 0 deletions tests/fixtures/test_rst_caption.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. The following test case is based on https://github.com/tiran/defusedxml/blob/f2c7c35b25f80c08923be49ac1f81e9cf95bd2ae/README.txt#L180
.. csv-table:: Multiplication
:header: "1", "2", "3", "4", "5"

1,2,3,4,5
2,4,6,8,10
3,6,9,12,15
4,8,12,16,20
5,10,15,20,25

0 comments on commit 0e1c2a3

Please sign in to comment.