Skip to content

Commit

Permalink
chore: char limits
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuBizien committed Jan 14, 2025
1 parent 6311927 commit 83ef15b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tinycss2/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ def serialize_name(value):
"\r": r"\D ",
"\f": r"\C ",
}
_re_string_value = re.compile("["+"".join(re.escape(e) for e in _replacement_string_value.keys()) + "]",
re.MULTILINE )

_re_string_value = "".join(re.escape(e) for e in _replacement_string_value.keys())
_re_string_value = re.compile("["+ _re_string_value + "]", re.MULTILINE )
def _serialize_string_value_match(match):
return _replacement_string_value[match.group(0)]
def serialize_string_value(value):
return _re_string_value.sub(lambda match: _replacement_string_value[match.group(0)], value)
return _re_string_value.sub(_serialize_string_value_match, value)


def serialize_url(value):
Expand Down

0 comments on commit 83ef15b

Please sign in to comment.