Skip to content

Commit

Permalink
Merge pull request #121 from mila/112-inline-styles
Browse files Browse the repository at this point in the history
Do not allow inline styles
  • Loading branch information
dstufft authored Sep 18, 2018
2 parents 12d6bd0 + e644d14 commit 5d80e46
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions readme_renderer/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# Custom Additions
"*": ["id"],
"hr": ["class"],
"img": ["src", "width", "height", "alt", "align", "class", "style"],
"img": ["src", "width", "height", "alt", "align", "class"],
"span": ["class"],
"th": ["align"],
"td": ["align"],
Expand All @@ -51,7 +51,6 @@
}

ALLOWED_STYLES = [
"width", "height",
]


Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/test_CommonMark_style.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img src="https://example.com/badge.png" style="width: 20px; height: 20px;">
<img src="https://example.com/badge.png">
2 changes: 1 addition & 1 deletion tests/fixtures/test_CommonMark_style.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img src="https://example.com/badge.png" style="width: 20px; height: 20px; color:red;">
<img src="https://example.com/badge.png">
2 changes: 1 addition & 1 deletion tests/fixtures/test_GFM_style.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img src="https://example.com/badge.png" style="width: 20px; height: 20px;">
<img src="https://example.com/badge.png">
2 changes: 1 addition & 1 deletion tests/fixtures/test_GFM_style.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img src="https://example.com/badge.png" style="width: 20px; height: 20px; color:red;">
<img src="https://example.com/badge.png">
2 changes: 1 addition & 1 deletion tests/fixtures/test_rst_png_attrs.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img alt="alternate text" class="align-right" src="https://example.com/badge.png" style="width: 25.0%; height: 100px;">
<img alt="alternate text" class="align-right" src="https://example.com/badge.png">
2 changes: 1 addition & 1 deletion tests/fixtures/test_rst_svg_attrs.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<img alt="alternate text" class="align-right" src="https://example.com/badge.svg" style="width: 25.0%; height: 100px;">
<img alt="alternate text" class="align-right" src="https://example.com/badge.svg">

0 comments on commit 5d80e46

Please sign in to comment.