Revert the change in patterns matching beginning or space at the beginning because it prevented the use of markdown on hastags and mentions.

ap-processing-improvements
Alain St-Denis 2023-07-14 08:55:30 -04:00
rodzic d577e39777
commit 7d750d3365
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -9,8 +9,8 @@ from bs4.element import NavigableString
from commonmark import commonmark
ILLEGAL_TAG_CHARS = "!#$%^&*+.,@£/()=?`'\\{[]}~;:\"’”—\xa0"
TAG_PATTERN = re.compile(r'(^|\s)(#[\w]+)', re.UNICODE)
MENTION_PATTERN = re.compile(r'(^|\s)(@{?[\S ]?[^{}@]+[@;]?\s*[\w\-./@]+[\w/]+}?)', re.UNICODE)
TAG_PATTERN = re.compile(r'(#[\w]+)', re.UNICODE)
MENTION_PATTERN = re.compile(r'(@{?[\S ]?[^{}@]+[@;]?\s*[\w\-./@]+[\w/]+}?)', re.UNICODE)
def decode_if_bytes(text):