Use ATX headers instead of SETEXT

This commit is contained in:
2025-05-17 03:53:15 +02:00
parent 901d6cb1a6
commit 96bcd81191

View File

@ -68,8 +68,18 @@ def replace_tags_in_text_message(entry: Entry) -> str:
first_image: str = get_first_image(summary, content) first_image: str = get_first_image(summary, content)
summary = markdownify(html=summary, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) summary = markdownify(
content = markdownify(html=content, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) html=summary,
strip=["img", "table", "td", "tr", "tbody", "thead"],
escape_misc=False,
heading_style="ATX",
)
content = markdownify(
html=content,
strip=["img", "table", "td", "tr", "tbody", "thead"],
escape_misc=False,
heading_style="ATX",
)
if "[https://" in content or "[https://www." in content: if "[https://" in content or "[https://www." in content:
content = content.replace("[https://", "[") content = content.replace("[https://", "[")
@ -189,8 +199,18 @@ def replace_tags_in_embed(feed: Feed, entry: Entry) -> CustomEmbed:
first_image: str = get_first_image(summary, content) first_image: str = get_first_image(summary, content)
summary = markdownify(html=summary, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) summary = markdownify(
content = markdownify(html=content, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) html=summary,
strip=["img", "table", "td", "tr", "tbody", "thead"],
escape_misc=False,
heading_style="ATX",
)
content = markdownify(
html=content,
strip=["img", "table", "td", "tr", "tbody", "thead"],
escape_misc=False,
heading_style="ATX",
)
if "[https://" in content or "[https://www." in content: if "[https://" in content or "[https://www." in content:
content = content.replace("[https://", "[") content = content.replace("[https://", "[")