Skip to content

Commit

Permalink
'description_html' can be modified.
Browse files Browse the repository at this point in the history
  • Loading branch information
zerline committed Feb 17, 2020
1 parent 9d455dd commit ed34d6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions packages/controls/src/widget_description.ts
Expand Up @@ -54,6 +54,11 @@ export class DescriptionView extends DOMWidgetView {
this.label.style.display = 'none';

this.listenTo(this.model, 'change:description', this.updateDescription);
this.listenTo(
this.model,
'change:description_html',
this.updateDescription
);
this.listenTo(this.model, 'change:tabbable', this.updateTabindex);
this.updateDescription();
this.updateTabindex();
Expand Down
9 changes: 5 additions & 4 deletions tests/test_sanitizer.ipynb
Expand Up @@ -61,7 +61,8 @@
"metadata": {},
"outputs": [],
"source": [
"Checkbox(description=\"<b>ok</b><i>OK</i>\", description_html=False)"
"c = Checkbox(description=\"<b>ok</b><i>OK</i>\")\n",
"c"
]
},
{
Expand All @@ -70,7 +71,7 @@
"metadata": {},
"outputs": [],
"source": [
"Checkbox(description=\"<b>ok</b><script>OK</script>\", description_html = True)"
"c.description_html = True"
]
},
{
Expand All @@ -79,7 +80,7 @@
"metadata": {},
"outputs": [],
"source": [
"Label(\"<script>ok</script>\")"
"Checkbox(description=\"<b>ok</b><script>OK</script>\", description_html = True)"
]
},
{
Expand All @@ -88,7 +89,7 @@
"metadata": {},
"outputs": [],
"source": [
"Label.__mro__, Text.__mro__"
"Label(\"<b>OK</b><script>ok</script>\", description_html=True)"
]
}
],
Expand Down

0 comments on commit ed34d6d

Please sign in to comment.