formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Any control's Lable field is rendering the html tag

copaliwal opened this issue · comments

Environment


Steps to Reproduce

  1. Create a form with any control
  2. In the display tab, add the below HTML in the Lable field
    <img src='#'>
  3. It renders the HTML at the label place

Expected behaviour

The HTML tag must be displayed as text and should not be interpreted.


Screenshot

image

Full screenshot

image

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']
  }
});