Closed wowselim closed 1 year ago
It doesn't look like you need to do anything special to have a newline in the attribute text. Everywhere that I've tried, it worked by using a newline literal instead of
.
Example:
div().withTitle("Line 1\nLine 2")
produces
<div title="Line 1
Line 2">Secret</div>
which rendered to two lines when the mouse hovered over the div.
That does work indeed. It' weird because it's the only newlines when viewing the page source but I'm fine with that since it works 🤷
Is there an easy way to create title attributes with multiple lines?
Here's an example of what I'm trying to do: https://jsfiddle.net/hvn8o19t/
I couldn't find a way to pass this as an attribute to j2html without it being escaped.