Skip to content

Commit

Permalink
Merge pull request #20 from evtn/dev
Browse files Browse the repository at this point in the history
fix xml_parse on comments
  • Loading branch information
evtn authored May 4, 2024
2 parents d38c081 + 502fa70 commit de3d8fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "soda-svg"
packages = [{include = "soda"}]
version = "2.0.1"
version = "2.0.2"
description = "Fast SVG generation tool"
authors = ["Dmitry Gritsenko <soda@evtn.ru>"]
license = "MIT"
Expand Down
5 changes: 4 additions & 1 deletion soda/xml_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ def process_children(element: etree._Element) -> Iterable[Tag]:


def element_to_tag(element: etree._Element) -> Tag:
if not isinstance(element.tag, str):
if isinstance(element.tag, etree._Comment):
return XMLComment(element.tag.text)

if not isinstance(element.tag, str):
return Literal("")

tag_name = element.tag.split("}")[-1]
raw_attributes = element.attrib

Expand Down

0 comments on commit de3d8fc

Please sign in to comment.