Ellipsis erased
This commit is contained in:
@@ -426,7 +426,7 @@ def build_post_text_variants(title_text: str, link: str, max_length: int = 300):
|
||||
available = max_length - reserve
|
||||
if available > 20:
|
||||
# FIX: Use single char '…' and strip trailing dots/spaces
|
||||
truncated_title = title_text[:available - 1].rstrip(" .") + "…"
|
||||
truncated_title = title_text[:available].rstrip(" .")
|
||||
add_variant(f"{truncated_title}\n\n{link}")
|
||||
|
||||
# Variant 2: només títol (truncat si cal)
|
||||
@@ -435,7 +435,7 @@ def build_post_text_variants(title_text: str, link: str, max_length: int = 300):
|
||||
add_variant(title_text)
|
||||
else:
|
||||
# FIX: Use single char '…' and strip trailing dots/spaces
|
||||
truncated = title_text[:max_length - 1].rstrip(" .") + "…"
|
||||
truncated = title_text[:max_length - 1].rstrip(" .")
|
||||
add_variant(truncated)
|
||||
|
||||
# Variant 3: només link (si no hi ha títol)
|
||||
@@ -500,7 +500,7 @@ def make_rich(content: str):
|
||||
text_builder.text(trailing)
|
||||
|
||||
elif cleaned_word.startswith("#") and len(cleaned_word) > 1:
|
||||
tag_name = cleaned_word[1:].rstrip(".,;:!?)'\"…")
|
||||
tag_name = cleaned_word[1:].rstrip(".,;:!?)'\"")
|
||||
if tag_name:
|
||||
text_builder.tag(cleaned_word, tag_name)
|
||||
trailing = word[len(cleaned_word):]
|
||||
|
||||
Reference in New Issue
Block a user