This commit is contained in:
Thibaud Chupin 2025-03-02 20:41:31 +01:00 committed by GitHub
commit c633f4380e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -223,7 +223,8 @@ SENTENCE_SPLITTER_ONLY_NEWLINE = re.compile("\n")
def split_title(text: str) -> tuple[str, str]:
"""Splits the first sentence off from a text."""
sep = SENTENCE_SPLITTER_ONLY_NEWLINE.search(text.lstrip())
text = text.lstrip()
sep = SENTENCE_SPLITTER_ONLY_NEWLINE.search(text)
if not sep:
sep = SENTENCE_SPLITTER.search(text)
if not sep: