< and > not correctly parsed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Scour |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Hi,
< and > are sometimes used in Inkscape's tutorials (tracing, tips...).
But when I scour that text:
<flowDiv xml:space=
into a <path> element for your SVG drawing. These short notes
should help you become acquainted with how it works.
</flowDiv>
< is replaced with < and I get:
<flowDiv xml:space=
into a <path> element for your SVG drawing. These short notes
should help you become acquainted with how it works.
</flowDiv>
And Inkscape returns an error if I try to open it.
Commenting the following lines:
# encode > as > (TODO: is this necessary?)
if str.find('>') != -1:
newstr = str.replace('>', '>')
in def makeWellFormed(str) fixes this issue.
But can <MyText> considered valid?
Regards.
Changed in scour: | |
status: | Fix Committed → Fix Released |
Thanks for catching this, Nico!
I have fixed this in my local copy. Will checkin tonight, but for now you can replace the makeWellFormed() function with this:
def makeWellFormed( str):
newstr = ''
xml_ents = { '<':'<', '>':'>', '&':'&', "'":''', '"':'"'}
for c in str:
if c in xml_ents:
newstr += xml_ents[c]
else:
newstr += c
return newstr
Sorry about the trouble.