Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow picture through #299

Merged
merged 2 commits into from
Jan 22, 2024
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
2 changes: 1 addition & 1 deletion readme_renderer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pulling this out now that our CI runs on 3.x latest

if content_type == "text/x-rst":
content_format = "rst"
elif content_type == "text/markdown":
Expand Down
2 changes: 1 addition & 1 deletion readme_renderer/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/test_GFM_picture.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<picture>
<img src="/media/cc0-images/painted-hand-298-332.jpg" alt="">
</picture>
3 changes: 3 additions & 0 deletions tests/fixtures/test_GFM_picture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<picture>
<img src="/media/cc0-images/painted-hand-298-332.jpg" alt="" />
</picture>