& nbsp; in Raphael JS

I need to do something like:

paper.text(Left, Top, " " + this._p.Label + ":");
paper.text(Left, Top, " " + this._p.Label + ":");

But the added spaces will not be displayed or displayed as  in the text.

I tried:

label.attr({"xml:space": "preserve"});

... no effect.

Is there any access to SVG node in Raphael JS, so I can install

setAttributeNS("http://www.w3.org/XML/1998/namespace","space","preserve");

(or is there any other way to solve this?)

+5
source share
2 answers

Yes, you can definitely apply this attribute with names directly to the SVG element controlled by Raphael. It's simple:

paper.canvas.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");

Demonstrated as functional here .

+3
source

[1] , , , \u00a0. .replace(/ /g,'\u00a0').


1 node Mac Safari v.6.0.5. , .
+2

All Articles