Reputation:
This SVG text will be displayed in 2 lines on Firefox, but in just 1 line on Chrome:
document.querySelector("text").textContent = "This is the first line \n This is the second line";
text {
white-space: pre;
}
<svg>
<text x="10" y="50"></text>
</svg>
Is there any reliable source describing the current compatibility of white-space: pre;
in an SVG text with newline characters? I've looked at MDN, Caniuse etc. but couldn't find anything.
(by the way I believe there's nothing in the specs and Firefox implementation decided to do that independently, is that correct?)
Upvotes: 1
Views: 951
Reputation: 124219
Upvotes: 3