Skip to content

Commit

Permalink
typogrify: Change some en dashes to em dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed Nov 2, 2024
1 parent b305e96 commit 5ea11d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions se/typography.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def typogrify(xhtml: str, smart_quotes: bool = True) -> str:
# Replace horizontal bar with em dash
xhtml = xhtml.replace("―", "—")

# Replace space + en dash with em dash
xhtml = regex.sub(r"\s–\s?", f"{se.WORD_JOINER}—", xhtml)

# Replace sequential em dashes with the two or three em dash character
xhtml = xhtml.replace("———", "⸻")
xhtml = xhtml.replace("——", "⸺")
Expand Down

0 comments on commit 5ea11d8

Please sign in to comment.