0

below is my code:

<RaisedButton id="abc" title={formatHTMLMessage({id: 'T_TEXT_TOOL_TITLE'})} className="abcClass" />

T_TEXT_TOOL_TITLE=Some Text to show&#039;

When rendering the above component in the UI, the formatHTMLMessage function do not render the &#039; character as a single quote ('), instead it displays &#039;.

I tried another function formatMessage() as well, but it did not work. Please find the screenshot :

screenshot

1 Answers1

0

Please try the below code. Hope it will fix the issue.

const parser = new DOMParser();
T_TEXT_TOOL_TITLE=Some Text to show&#039;

<RaisedButton id="abc" title={parser.parseFromString(formatHTMLMessage({id: 'T_TEXT_TOOL_TITLE'}), 'text/html').body.textContent} className="abcClass"/>