From 49659071ad01139ecd353875a90d5927a5fd944d Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Mon, 22 Jan 2024 14:58:21 -0500 Subject: [PATCH 1/2] allow picture through fixes #297 --- readme_renderer/clean.py | 2 +- tests/fixtures/test_GFM_picture.html | 3 +++ tests/fixtures/test_GFM_picture.md | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/test_GFM_picture.html create mode 100644 tests/fixtures/test_GFM_picture.md diff --git a/readme_renderer/clean.py b/readme_renderer/clean.py index b081e28..6cd5972 100644 --- a/readme_renderer/clean.py +++ b/readme_renderer/clean.py @@ -27,7 +27,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", + "figcaption", "picture", } ALLOWED_ATTRIBUTES = { diff --git a/tests/fixtures/test_GFM_picture.html b/tests/fixtures/test_GFM_picture.html new file mode 100644 index 0000000..460cf35 --- /dev/null +++ b/tests/fixtures/test_GFM_picture.html @@ -0,0 +1,3 @@ + + + diff --git a/tests/fixtures/test_GFM_picture.md b/tests/fixtures/test_GFM_picture.md new file mode 100644 index 0000000..a6de454 --- /dev/null +++ b/tests/fixtures/test_GFM_picture.md @@ -0,0 +1,3 @@ + + + From bad179e89fbd1b5efe219530f8d6854d3a981523 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Mon, 22 Jan 2024 15:15:16 -0500 Subject: [PATCH 2/2] lint: fixed in python 3.12 --- readme_renderer/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme_renderer/__main__.py b/readme_renderer/__main__.py index d3ebab3..e7c1187 100644 --- a/readme_renderer/__main__.py +++ b/readme_renderer/__main__.py @@ -28,7 +28,7 @@ def main(cli_args: Optional[List[str]] = None) -> None: # Infer the format of the description from package metadata. if not content_format: - content_type = message.get("Description-Content-Type", "text/x-rst") # type: ignore[attr-defined] # noqa: E501 https://github.com/python/typeshed/issues/10021 + content_type = message.get("Description-Content-Type", "text/x-rst") if content_type == "text/x-rst": content_format = "rst" elif content_type == "text/markdown":