Skip to content

Commit

Permalink
Little more styling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerline committed Jun 8, 2020
1 parent 5514bb9 commit 4b84b90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/base-manager/src/manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function default_inline_sanitize(html: string): string {
'*': ['aria-*', 'style', 'title'],
a: ['href'],
img: ['src'],
style: ['media']
style: ['media', 'type']
}
});
}
Expand Down
13 changes: 11 additions & 2 deletions tests/test_sanitizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"metadata": {},
"outputs": [],
"source": [
"Text(description=\"<p><i>italic</i></p> <p><strong>bold</strong></p>\", description_html=False)"
"Text(description=\"<style type='type/css'>SPAN {text-decoration:underline;}</style><img src='jlogo-small.png' title='àçeù' /> <span style='color: orange'>NOT styled</span>\", description_html=False)"
]
},
{
Expand All @@ -42,7 +42,16 @@
"metadata": {},
"outputs": [],
"source": [
"Text(description=\"<style type='type/css'>SPAN {text-decoration:underline;}</style><img src='jlogo-small.png' title='àçeù' /> <span style='color: orange'>a styled label</span>\", description_html=True)"
"Text(description=\"<style type='type/css'>SPAN {text-decoration:underline;}</style><img src='jlogo-small.png' title='àçeù' /> <span style='color: orange'>styled</span>\", description_html=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Textarea(description=\"<style type='type/css'>SPAN {color: blue;}</style><img src='jlogo-small.png' title='àçeù' /> <span style='text-decoration:underline;''>underlined</span>\", description_html=True)"
]
}
],
Expand Down

0 comments on commit 4b84b90

Please sign in to comment.