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.
|
# Group all units together in a capture group.
|
||||||
+ "|".join(units)
|
+ "|".join(units)
|
||||||
# Word boundary check at end of unit to ensure proper handling of units like A, Ah etc.
|
# Word boundary check at end of unit to ensure proper handling of units like A, Ah etc.
|
||||||
+ r")\b"
|
+ r")(?!\w)"
|
||||||
)
|
)
|
||||||
|
|
||||||
value: str
|
value: str
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ def test_special_units_html():
|
|||||||
"""Test special units: Don't put space before ° and %."""
|
"""Test special units: Don't put space before ° and %."""
|
||||||
assertions = {
|
assertions = {
|
||||||
"100%": "100%",
|
"100%": "100%",
|
||||||
|
"100 %": "100%",
|
||||||
"42,24°": "42,24°",
|
"42,24°": "42,24°",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user