Closed chanicpanic closed 2 years ago
When the passed group element has no children, Document.add_path incorrectly adds the path to the root element.
Document.add_path
Example:
doc = Document() empty = doc.add_group(group_attribs={"id": "empty"}) doc.add_path("M 0,0 L 1,1", group=empty) print(doc)
Output:
<svg xmlns:svg="http://www.w3.org/2000/svg"><svg:g id="empty" /><path d="M 0,0 L 1,1" /></svg>
Expected Output:
<svg xmlns:svg="http://www.w3.org/2000/svg"><svg:g id="empty"><path d="M 0,0 L 1,1" /></svg:g></svg>
When the passed group element has no children,
Document.add_path
incorrectly adds the path to the root element.Example:
Output:
Expected Output: