I was not able to figure out how to create multiple lines of text with a single paper.text element in Snap.svg. I tried using the methods mentioned for raphael.js, such as \ n, but this does nothing for snap.svg.
I tried using \ n and variants of this, but nothing works. It seemed strange to me that it is very easy to do in raphael.js (this is in the documentation), but still snap.svg docs do not mention anything about it, and I did not find anything on the Internet.
Help would be greatly appreciated, thanks!
http://jsfiddle.net/f3mkqovm/
var myRect = paper.text(100, 100, ["Lorem", "<br>","ipsum dolor sit \n amet /n see ", "\n","amend"]).attr({ fill : 'black' });
EDIT: Here's the jsfiddle where \ n works for raphael. Since snap.svg is not built into jsfiddle, I don't know that another fiddle will help anyone. http://jsfiddle.net/yf8364mp/
source share