0

Using svg-edit and some of the variants I've found that seem like they are based on the same JS libraries, I create a basic drawing then using either source editor within svg-edit, or loading up an external Notepad-created SVG, that some attributes on <g> elements for example are tossed out.

I want to amend a typical element with let's say a class="Position" it works, and retains the attribute through edit cycles. But when I use foo="bar" that attribute seems to get discarded completely.

This is fairly inconvenient because I want to use svg-edit to create an arbitrary drawing with some unique-to-me attributes that my code can later recognize.

Is this a dumb question? Am I missing something fundamental about SVGs with arbitrary non-standard type attributes included (and for retention)?

Dave
  • 378
  • 4
  • 14
  • Oh maybe I should try a `data-` prefix on my attributes, I read somewhere this is a way to isolate non-standard type attributes. – Dave May 19 '17 at 23:28
  • 1
    data- is mostly for html (or SVG in html), for XML (standalone SVG) the usual mechanism for foreign content is namespaces. – Robert Longson May 20 '17 at 06:25

0 Answers0