Skip to content

Commit

Permalink
typogrify: Remove dash after two- or three-em-dash
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed Jan 3, 2025
1 parent feb2f89 commit 1f5dbe4
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 @@ -376,6 +376,9 @@ def typogrify(xhtml: str, smart_quotes: bool = True) -> str:
# Replace single obscured year digit with figure dash
xhtml = regex.sub(r"\b([0-9]{3})-([^0-9\p{Letter}])(?!abbr)", r"\1‒\2", xhtml)

# Replace a common error, two- or three-em-dash followed by dash
xhtml = regex.sub(r"(⸺|⸻)-", r"\1", xhtml)

return xhtml

def hyphenate(xhtml: Union[str, EasyXmlTree], language: Optional[str], ignore_h_tags: bool = False) -> str:
Expand Down

0 comments on commit 1f5dbe4

Please sign in to comment.