t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Automatically replace \n with <br> #772

Closed lionralfs closed 6 years ago

lionralfs commented 6 years ago

This closes #740 and #770 as it transforms \n to <br> tags when used like this:

swal('Hello\nWorld');

Implementation might look a little funky, but I wanted to stay away from .innerHTML.

Also: tests 😁

t4t5 commented 6 years ago

Awesome. And you even added a test ❤️