Skip to content

Instantly share code, notes, and snippets.

@vicapow
Created July 8, 2014 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicapow/cd2046770ceea172d4db to your computer and use it in GitHub Desktop.
Save vicapow/cd2046770ceea172d4db to your computer and use it in GitHub Desktop.
testing newlines in svg
<!DOCTYPE html>
<html>
<body>
<h1> svg text with multiple text elements</h1>
<svg width="400" height="400">
<text y="100">
<tspan x="0" dy="1.4em">
wow this is cool
</tspan>
<tspan x="0" dy="1.4em">
new line!
</tspan>
</text>
</svg>
<h1> svg text element with a newline (fail)</h1>
<svg width="400" height="400">
<text y="100">wow this is cool
new line!</text>
</svg>
<h1> svg txt with an html newline entity (fail)</h1>
<svg width="400" height="400">
<text y="100"> wow this is cool &#xA; new line! </text>
</svg>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment