From 99f028a82ce0c748ef6f5361a18ea3a3d5113171 Mon Sep 17 00:00:00 2001 From: Gijs van Tulder Date: Fri, 20 Sep 2024 19:28:17 +0200 Subject: [PATCH] typogrify: Do not remove space between comma and fraction. --- se/typography.py | 2 +- tests/draft_commands/typogrify/test-1/golden/typogrify.xhtml | 2 ++ tests/draft_commands/typogrify/test-1/in/typogrify.xhtml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/se/typography.py b/se/typography.py index 39c7ba2c..17f25e68 100644 --- a/se/typography.py +++ b/se/typography.py @@ -318,7 +318,7 @@ def typogrify(xhtml: str, smart_quotes: bool = True) -> str: xhtml = regex.sub(r"\b(?])\-([0-9,]+)", r"\1−\2", xhtml) diff --git a/tests/draft_commands/typogrify/test-1/golden/typogrify.xhtml b/tests/draft_commands/typogrify/test-1/golden/typogrify.xhtml index 26b6edb4..a8c0ce25 100644 --- a/tests/draft_commands/typogrify/test-1/golden/typogrify.xhtml +++ b/tests/draft_commands/typogrify/test-1/golden/typogrify.xhtml @@ -40,6 +40,8 @@
  • 123¾
  • 123⅚
  • 123¹⁄₈₀₀
  • +
  • 1,234¼
  • +
  • keep space after comma, ¹⁄₈₀₀
  • diff --git a/tests/draft_commands/typogrify/test-1/in/typogrify.xhtml b/tests/draft_commands/typogrify/test-1/in/typogrify.xhtml index 762a65d4..7af5ab30 100644 --- a/tests/draft_commands/typogrify/test-1/in/typogrify.xhtml +++ b/tests/draft_commands/typogrify/test-1/in/typogrify.xhtml @@ -40,6 +40,8 @@
  • 123 ¾
  • 123⅚
  • 123¹⁄₈₀₀
  • +
  • 1,234 ¼
  • +
  • keep space after comma, ¹⁄₈₀₀