fix: parse percentage as unit
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ class Unit(SpanToken):
|
||||
# Group all units together in a capture group.
|
||||
+ "|".join(units)
|
||||
# Word boundary check at end of unit to ensure proper handling of units like A, Ah etc.
|
||||
+ r")\b"
|
||||
+ r")(?!\w)"
|
||||
)
|
||||
|
||||
value: str
|
||||
|
||||
@@ -40,6 +40,7 @@ def test_translated_units_html():
|
||||
def test_special_units_html():
|
||||
"""Test special units: Don't put space before ° and %."""
|
||||
assertions = {
|
||||
"100%": "100%",
|
||||
"100 %": "100%",
|
||||
"42,24°": "42,24°",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user