Tuesday, 27 August 2013

How do I display html encoded values in svg?

How do I display html encoded values in svg?

I am using d3 to generate svg and end up with markup similar to the
following:
<text class="rule" text-anchor="middle">&amp;pound;10K</text>
Compare to similar html that renders as expected.
<div>
&pound;20,160 - &pound;48,069
</div>
Is there a property I need to set on the svg tag to get a similar type of
encoding? I tried adding a meta tag to the page <meta name="content"
content="application/xhtml+xml; charset=utf-8" /> but this did not work.

No comments:

Post a Comment