Opened 10 years ago

Closed 10 years ago

#15994 closed defect (duplicate)

dojox.gfx.utils.toSvg creates broken svg files when a text shape contains "="

Reported by: redstone Owned by: Eugene Lazutkin
Priority: undecided Milestone: tbd
Component: DojoX GFX Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:


The dojox.gfx.utils.toSvg function creates invalid svg format data if an input surface contains the text shape with "=" as its inner string.

e.g. for the text shape like createText({text:"a=b"}), the output svg would be <svg><text>a="b</text"></svg>

This seems due to the string replacement in the function dojox.gfx.utils._cleanSvg. In the function _cleanSvg, the regex replacement, svg.replace(/[=](["']+?)(\s|>)/g,'="$1"$2') in the source code, must take place only in svg tags while the above example is not.

I currently avoid the unexpected replacement by quoting the inner string, like createText({text:"'a=b'"}).


Change History (1)

comment:1 Changed 10 years ago by Patrick Ruzand

Resolution: duplicate
Status: newclosed

Duplicate of #15818.

Note: See TracTickets for help on using tickets.