mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
generate titles from microblog posts - sentences with a ? need it added back on
This commit is contained in:
parent
f111b50041
commit
e2e20c76a0
1 changed files with 2 additions and 0 deletions
|
@ -263,6 +263,8 @@ def microblog_content_to_title(html: str) -> str:
|
||||||
question_index if question_index != -1 else float('inf'))
|
question_index if question_index != -1 else float('inf'))
|
||||||
|
|
||||||
if end_index != -1:
|
if end_index != -1:
|
||||||
|
if question_index != -1:
|
||||||
|
end_index += 1 # Add the ? back on
|
||||||
title = title[:end_index]
|
title = title[:end_index]
|
||||||
|
|
||||||
if len(title) > 150:
|
if len(title) > 150:
|
||||||
|
|
Loading…
Add table
Reference in a new issue