Skip to content

Commit

Permalink
Expanding URLs in messages from web interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kutzowsky committed Nov 20, 2024
1 parent c088732 commit fbcb30c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/wwwparsing/MarkupParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ def get_message_text(html_element):
if not message_text_element:
return ''

return message_text_element.text.strip()
message_link_elements = message_text_element.find_all('a', href=lambda href: href and ('r.blabler.pl' in href))
text = message_text_element.text.strip()

for link_element in message_link_elements:
text = text.replace(f'[{link_element.text}]', link_element['title'])

return text

@staticmethod
def get_message_timestamp(html_element):
Expand Down

0 comments on commit fbcb30c

Please sign in to comment.