Render raw html in checkbox label

[MAILPOET-2803]
This commit is contained in:
Pavel Dohnal
2020-04-30 13:03:40 +02:00
committed by Veljko V
parent 17545f1b79
commit 71106cc90e
3 changed files with 6 additions and 15 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable react/no-danger */
import React from 'react';
import {
Panel,
@@ -109,6 +110,7 @@ const CustomCheckboxEdit = ({ attributes, setAttributes, clientId }) => {
if (attributes.mandatory) {
checkboxLabel += ' *';
}
return (
<ParagraphEdit className={attributes.className}>
{inspectorControls}
@@ -121,7 +123,7 @@ const CustomCheckboxEdit = ({ attributes, setAttributes, clientId }) => {
checked={isChecked()}
className="mailpoet_checkbox"
/>
{checkboxLabel}
<span dangerouslySetInnerHTML={{ __html: checkboxLabel }} />
</label>
</div>
</ParagraphEdit>