Skip to main content

Remember to escape hashtags

ID
52cae81
date
2024-01-06 11:01:53+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
1c3e08a
message
Remember to escape hashtags
changed files
1 file, 1 addition

Changed files

textexpander/get_tweet_text.py (1434) → textexpander/get_tweet_text.py (1470)

diff --git a/textexpander/get_tweet_text.py b/textexpander/get_tweet_text.py
index c14f764..e2a7638 100755
--- a/textexpander/get_tweet_text.py
+++ b/textexpander/get_tweet_text.py
@@ -43,6 +43,7 @@ if __name__ == "__main__":
     # username = soup.find("div", attrs={"data-testid": "User-Name"}).text.replace(f'@{handle}', '').strip()
 
     text = soup.find("div", attrs={"data-testid": "tweetText"}).text
+    text = text.replace("#", "\\#")
 
     time = datetime.datetime.fromisoformat(soup.find("time").attrs["datetime"])