text: sanitize html (escape "<" & ">") (#562)
This commit is contained in:
parent
65bb430512
commit
b332cae3a5
2 changed files with 2 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
- widgets
|
||||
- frames: allow loading local html files without requiring a web server to serve them
|
||||
- text: escape html tags characters (`<` & `>`)
|
||||
|
||||
## 0.47.4
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ module.exports = class Text extends Widget {
|
|||
setValue(v, options={}) {
|
||||
|
||||
this.value = v==null ? this.defaultValue : v
|
||||
this.widget.innerHTML = iconify(String(this.value).replace(/\n/g,'<br/>'))
|
||||
this.widget.innerHTML = iconify(String(this.value).replace(/</g, '<').replace(/>/g, '>').replace(/\n/g,'<br/>'))
|
||||
|
||||
if (options.sync) this.changed(options)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue