'Cannot make a new line using <br /> html
I have a problem breaking down 1 line using <br />
, I have converted to string but it doesn't work. I have followed this https://stackoverflow.com/questions/63574937/how-to-convert-html-string-into-plain-text-in-react
answer to follow edit, it still doesn't work.
This intl.formatMessage({ id: "AUTH.LOGIN.DESCRIPTION.1" }) is System may takes some time to generate the email. Kindly login when you had received the email. <br /> Thank you for your understanding and apologise for the inconvenience caused.
const htmlFormatMessage = intl.formatMessage({ id: "AUTH.LOGIN.DESCRIPTION.1" });
const htmlString = htmlFormatMessage;
const plainString = htmlString.replace(/<br\/>/gi, '\n');
<p className="text-muted font-weight-bold">
{plainString}
</p>
Now my result is shown below:
I want the actual result to be shown below:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|