[Bug] Any control's Lable field is rendering the html tag
copaliwal opened this issue · comments
Chandrashekhar Paliwal commented
Environment
- https://portal.form.io/
- OR
- formiojs: 4.14.8
Steps to Reproduce
- Create a form with any control
- In the display tab, add the below HTML in the Lable field
<img src='#'>
- It renders the HTML at the label place
Expected behaviour
The HTML tag must be displayed as text and should not be interpreted.
Screenshot
Full screenshot
Travis Tidwell commented
I am all but certain that this is the DOM purify routine that is stripping out the html. There is a way to configure the tags so that it will accept IMG within the renderer. Something like this may work.
Formio.createForm(document.getElementById('formio'), '.....', {
sanitizeConfig: {
addTags: ['img']
}
});