Skip to content

Commit ed34d6d

Browse files
author
Zerline
committed
'description_html' can be modified.
1 parent 9d455dd commit ed34d6d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/controls/src/widget_description.ts

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export class DescriptionView extends DOMWidgetView {
5454
this.label.style.display = 'none';
5555

5656
this.listenTo(this.model, 'change:description', this.updateDescription);
57+
this.listenTo(
58+
this.model,
59+
'change:description_html',
60+
this.updateDescription
61+
);
5762
this.listenTo(this.model, 'change:tabbable', this.updateTabindex);
5863
this.updateDescription();
5964
this.updateTabindex();

tests/test_sanitizer.ipynb

+5-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"metadata": {},
6262
"outputs": [],
6363
"source": [
64-
"Checkbox(description=\"<b>ok</b><i>OK</i>\", description_html=False)"
64+
"c = Checkbox(description=\"<b>ok</b><i>OK</i>\")\n",
65+
"c"
6566
]
6667
},
6768
{
@@ -70,7 +71,7 @@
7071
"metadata": {},
7172
"outputs": [],
7273
"source": [
73-
"Checkbox(description=\"<b>ok</b><script>OK</script>\", description_html = True)"
74+
"c.description_html = True"
7475
]
7576
},
7677
{
@@ -79,7 +80,7 @@
7980
"metadata": {},
8081
"outputs": [],
8182
"source": [
82-
"Label(\"<script>ok</script>\")"
83+
"Checkbox(description=\"<b>ok</b><script>OK</script>\", description_html = True)"
8384
]
8485
},
8586
{
@@ -88,7 +89,7 @@
8889
"metadata": {},
8990
"outputs": [],
9091
"source": [
91-
"Label.__mro__, Text.__mro__"
92+
"Label(\"<b>OK</b><script>ok</script>\", description_html=True)"
9293
]
9394
}
9495
],

0 commit comments

Comments
 (0)