scour does not clean comments if file starts with a comment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Low
|
jazzynico | ||
Scour |
Fix Released
|
Medium
|
Unassigned |
Bug Description
It is quite usual that creators put a comment on the top of the file with their name.
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by Me and My Uncle -->
<svg …>
This will keep scour from stripping comments in the file, as it will not descend the child nodes. Below patch fixes that, and keeps the offending line - what is the best choice many times.
@@ -2557,6 +2560,10 @@
if isinstance(element, xml.dom.
numComment
element.
+ elif isinstance(
+ # first element in document may be a comment
+ # just ignore it then
+ pass
else:
removeComm
elif isinstance(element, xml.dom.
file numbers may not match trunk, as my version includes the polyline patch of mine.
Changed in inkscape: | |
assignee: | nobody → JazzyNico (jazzynico) |
importance: | Undecided → Low |
milestone: | none → 0.49 |
status: | New → Triaged |
Changed in scour: | |
status: | Fix Committed → Fix Released |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
It's also common that vector editors put a comment at the start of files with their name, which sometimes people want to remove. It would be better as an option.