Skip to content

Commit

Permalink
correct regex for fontfamily to include '' quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize committed Jul 21, 2022
1 parent 0a4fedb commit 1649e08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = svgelements
version = 1.7.1
version = 1.7.2
description = Svg Elements Parsing
long_description_content_type=text/markdown
long_description = file: README.md
Expand Down
6 changes: 3 additions & 3 deletions svgelements/svgelements.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
and the Arc can do exact arc calculations if scipy is installed.
"""

SVGELEMENTS_VERSION = "1.7.1"
SVGELEMENTS_VERSION = "1.7.2"

MIN_DEPTH = 5
ERROR = 1e-12
Expand Down Expand Up @@ -242,7 +242,7 @@
r"$"
)
REGEX_CSS_FONT_FAMILY = re.compile(
r'(?:([^\s";,]+|"[^";,]+"|serif|sans-serif|cursive|fantasy|monospace)),?\s*;?'
r"""(?:([^\s"';,]+|"[^";,]+"|'[^';,]+'|serif|sans-serif|cursive|fantasy|monospace)),?\s*;?"""
)

svg_parse = [("COMMAND", r"[MmZzLlHhVvCcSsQqTtAa]"), ("SKIP", PATTERN_COMMAWSP)]
Expand Down Expand Up @@ -7961,7 +7961,7 @@ def parse_font(self, font):
@property
def font_list(self):
return [
family[1:-1] if family.startswith('"') else family
family[1:-1] if family.startswith('"') or family.startswith("'") else family
for family in REGEX_CSS_FONT_FAMILY.findall(self.font_family)
]

Expand Down

0 comments on commit 1649e08

Please sign in to comment.