On Feb 9, 2012, at 9:49 AM, Andi McClure wrote:
I am trying to create a patch to Inkscape and it isn't working very well, I was hoping I could ask for some help.
I have been using Inkscape for creating resources for a video game I'm writing. As part of this I often attach custom attributes to XML nodes in the "XML Editor" window. When I do this, Inkscape gives me a nice big multiline editor window to enter my attribute text. Sometimes, I find myself needing to enter many lines of text or code into one of my custom attributes; when I do this, Inkscape handles newlines in a way that strikes me as incorrect and makes it very hard for me to get work done. Inkscape will allow me to enter, set and save multi-line attributes; however then later when I try to open the file, all the newlines will be erased, replaced with spaces. Although I understand newlines are rarely relevant in normal SVG, it seems very wrong to me that Inkscape allows me to enter content, save a file, and then reopen the file and it has been silently altered.
I'll have to poke about at a few more more details, but things might not do what you want them to. Though the most common route is to have some tag that includes xml:space="preserve". For our handling in specific, we probably have a few callbacks to tweak here and there in addition to the normal escaping.
The good approach will be to get a few different unit tests added that push in what *should* be working. Then we can more quickly narrow down each broken area.