From 0e1c2a37d0bf3e18e9431f7f4e07c74cc775f214 Mon Sep 17 00:00:00 2001 From: Tom Most Date: Mon, 28 May 2018 09:30:51 -0700 Subject: [PATCH] Allow (#105) --- readme_renderer/clean.py | 8 ++--- tests/fixtures/test_rst_caption.html | 50 ++++++++++++++++++++++++++++ tests/fixtures/test_rst_caption.rst | 10 ++++++ 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 tests/fixtures/test_rst_caption.html create mode 100644 tests/fixtures/test_rst_caption.rst diff --git a/readme_renderer/clean.py b/readme_renderer/clean.py index 1e273dd..d1ccb11 100644 --- a/readme_renderer/clean.py +++ b/readme_renderer/clean.py @@ -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 = { diff --git a/tests/fixtures/test_rst_caption.html b/tests/fixtures/test_rst_caption.html new file mode 100644 index 0000000..dc1ce6c --- /dev/null +++ b/tests/fixtures/test_rst_caption.html @@ -0,0 +1,50 @@ + + +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Multiplication
12345
12345
246810
3691215
48121620
510152025
diff --git a/tests/fixtures/test_rst_caption.rst b/tests/fixtures/test_rst_caption.rst new file mode 100644 index 0000000..52a278a --- /dev/null +++ b/tests/fixtures/test_rst_caption.rst @@ -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