Inkscape code cleanup

Discuss SVG code, accessible via the XML Editor.
krampstudio
Posts: 1
Joined: Tue Mar 15, 2011 6:38 pm

Inkscape code cleanup

Postby krampstudio » Tue Mar 15, 2011 6:52 pm

Hi,

I'm using Inkscape to create my SVG files an then I edit the XML to to some stuff with Javascript.
If I embed Js into the document, and then I edit it again with Inkscape, save the doc and it clean up my Javascript :(
The CDATA around my code is removed and all double quotes are replaced by their HTML entities.
For example, if I add the following code to a SVG doc:

Code: Select all

<script type="text/ecmascript"><![CDATA[
alert("test");
]]></scrip>


after an edition with Inkscape I have

Code: Select all

<script type="text/ecmascript">
alert(&quot;test&quot;);
</scrip>


Did somebody has the same issue? Is there some configuration to avoid that?

For informations, I'm running Inkscape 0.47 on Ubuntu 10.04

Thanks a lot

User avatar
prokoudine
Posts: 186
Joined: Sat Jun 09, 2007 4:32 am
Contact:

Re: Inkscape code cleanup

Postby prokoudine » Tue Mar 15, 2011 10:52 pm

Does it still happen with current 0.48.1?
http://libregraphicsworld.org — news and tutorials on free design software

meises
Posts: 2
Joined: Mon Oct 08, 2012 8:24 pm

Re: Inkscape code cleanup

Postby meises » Mon Oct 08, 2012 9:17 pm

Yes it still happens in 0.48.3

They tried to fix the Problem in https://bugs.launchpad.net/inkscape/+bug/199656 but for me it still doesen't work.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape code cleanup

Postby ~suv » Tue Oct 09, 2012 1:10 am

meises wrote:Yes it still happens in 0.48.3

They tried to fix the Problem in https://bugs.launchpad.net/inkscape/+bug/199656 but for me it still doesen't work.
To be expected (the bug is still present in 0.48.3.1, and the status of the bug report doesn't tell otherwise).

The fix is in current trunk (Status: 'Fix Committed'), and will be available in the next major release (Milestone: Inkscape 0.49).

chriswww
Posts: 383
Joined: Fri Nov 19, 2010 3:04 pm

Re: Inkscape code cleanup

Postby chriswww » Thu Nov 15, 2012 2:28 pm

What happens if instead of just adding script tags you add a javascript (stub) event in Inkscape interface and then save the file and add the code in your favorite editor? I thought it wasn't valid to just add javascript at top level in SVG that's not attached to anything, like in HTML file.


Return to “SVG / XML Code”