mirror of https://github.com/stijndcl/didier
Compare commits
No commits in common. "87e5b1be9f2aec6d6eb45f2b22eea84cabf72e36" and "21aa118ffa08e3e7e6cd879c7f9755869c53813b" have entirely different histories.
87e5b1be9f
...
21aa118ffa
|
|
@ -1,4 +1,3 @@
|
||||||
import re
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
@ -72,14 +71,8 @@ class UforaNotification(EmbedBaseModel):
|
||||||
|
|
||||||
def _clean_content(self, text: str):
|
def _clean_content(self, text: str):
|
||||||
# Escape *-characters because they mess up the layout
|
# Escape *-characters because they mess up the layout
|
||||||
# and non-breaking-spaces
|
text = text.replace("*", "\\*")
|
||||||
text = text.replace("*", "\\*").replace("\xa0", " ")
|
return md(text)
|
||||||
text = md(text)
|
|
||||||
|
|
||||||
# Squash consecutive newlines and ignore spaces inbetween
|
|
||||||
subbed = re.sub(r"\n+\s?\n+", "\n\n", text)
|
|
||||||
|
|
||||||
return subbed
|
|
||||||
|
|
||||||
def _published_datetime(self) -> datetime:
|
def _published_datetime(self) -> datetime:
|
||||||
"""Get a datetime instance of the publication date"""
|
"""Get a datetime instance of the publication date"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue