frinyvonnick / node-html-to-image

A Node.js module that generates images from HTML

Home Page:https://www.npmjs.com/package/node-html-to-image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I send line break from variable to html template?

MelarcAB opened this issue · comments

I want to send a string variable with a line break, but the result shows the < br > as if it were part of the text.

I tried with \n and \r but the result is still the same

Thanks

I think I was doing something bad, I tried "/n" but wasn't working. Now this solution works.

Put this in the html element style attribute:
white-space: pre-wrap;