diff --git a/post_parser.py b/post_parser.py index 81899db..42203e5 100644 --- a/post_parser.py +++ b/post_parser.py @@ -490,8 +490,9 @@ class PostParser: if description := getattr(webpage, "description", None): # Process the description to handle line breaks and possibly HTML processed_description = description.replace('\n', '
') - # Check for unlinked URLs and turn them into links - processed_description = self._add_hyperlinks_to_raw_urls(processed_description) + # Check for unlinked URLs and turn them into links only if description is short + if len(processed_description.strip()) <= 10: + processed_description = self._add_hyperlinks_to_raw_urls(processed_description) html_parts.append(f'
{processed_description}
') # Display URL for non-telegram links or when display_url is available @@ -502,11 +503,6 @@ class PostParser: html_parts.append(f'
{display_url}
') elif url: html_parts.append(f'
{url}
') - #else: - # # Show Telegram URL (more subtle than button) - # display_url = getattr(webpage, "display_url", None) - # if display_url: - # html_parts.append(f'
{display_url}
') # Add photo if available if photo := getattr(webpage, "photo", None): diff --git a/pyrogram-bridge.code-workspace b/pyrogram-bridge.code-workspace new file mode 100644 index 0000000..876a149 --- /dev/null +++ b/pyrogram-bridge.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file