diff --git a/post_parser.py b/post_parser.py index ecfe86c..ecb146c 100644 --- a/post_parser.py +++ b/post_parser.py @@ -306,6 +306,42 @@ class PostParser: html_content = [] data = self.process_message(message)['html'] + # Add CSS styles + html_content.append(''' + +''') + html_content.append(f'
') html_content.append(f'') html_content.append(f'') @@ -325,7 +361,7 @@ class PostParser: flags = self._extract_flags(message) if flags: - return f'' + return f'🏷 {", ".join(flags)}' return '' def process_message(self, message: Message) -> Dict[Any, Any]: @@ -575,6 +611,7 @@ class PostParser: try: parts = [] + # First line: reactions and views reactions_html = "" views_html = "" if reactions := getattr(message, "reactions", None): @@ -582,24 +619,24 @@ class PostParser: # Replace None or empty emoji with replacement character emoji = reaction.emoji if emoji is None or emoji == "None" or emoji == "": - emoji = "�" # Question mark as replacement for missing emojis - reactions_html += f'{emoji} {reaction.count} ' + emoji = "��" # Question mark as replacement for missing emojis + reactions_html += f'{emoji} {reaction.count}' reactions_html = reactions_html.rstrip() if views := getattr(message, "views", None): - views_html = f'{views} views' + views_html = f'👁 {views}' - # Combine reactions and views on the same line + # Combine reactions and views with proper spacing if reactions_html or views_html: - parts.append(f'{reactions_html} {views_html}') + parts.append(f'