I am trying to build a tool to convert a .CSV into formatted html code for production purposes. I have built the functionality of converting the file into a template literal using .map()
and React. When the browser renders the string it is one long line, and I want to format the render to make it easier to implement and edit. I have tried introducing <br>
and '\n' and see no change in the render. Are there any other methods to introduce a line break?
Code:
...
{contacts.map((contact) => (
`<p>Description<br>
<a class="link__external" href="${contact.url}" target="_blank">${contact.Name}</a>
 <a href="tel:">${contact.phoneNumber}
</a></p>`
))}
...
Browser render:
<p>Description<br> <a class="link__external" href="https://www.google.com/" target="_blank">Hello</a>   <a href="tel:">000-000-0000 </a></p>