Use $ instead of \Z for end of string

They're identical here, since re.M is not used, and the better-known
should be used, for readability.
This commit is contained in:
Adeodato Simó 2023-11-03 19:31:03 -03:00
parent 954a02126e
commit afad39bf80
No known key found for this signature in database
GPG key ID: CDF447845F1A986F

View file

@ -321,7 +321,7 @@ def format_links(content):
def _unwrap(text):
"""split surrounding brackets and trailing punctuation from a string of text"""
punct = re.compile(r'([.,;:!?"’”»]+)\Z')
punct = re.compile(r'([.,;:!?"’”»]+)$')
prefix = suffix = ""
if punct.search(text):