Fix HTML escape issues
This commit is contained in:
+3
-2
@@ -2,6 +2,7 @@ import datetime
|
|||||||
import msgs
|
import msgs
|
||||||
from utils import determineEmbedTweet, determineMediaToEmbed
|
from utils import determineEmbedTweet, determineMediaToEmbed
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
import html
|
||||||
|
|
||||||
def tweetDataToActivity(tweetData,embedIndex = -1):
|
def tweetDataToActivity(tweetData,embedIndex = -1):
|
||||||
content=""
|
content=""
|
||||||
@@ -9,10 +10,10 @@ def tweetDataToActivity(tweetData,embedIndex = -1):
|
|||||||
if tweetData['replyingTo'] is not None:
|
if tweetData['replyingTo'] is not None:
|
||||||
content += f"<blockquote>↪️ <i>Replying to @{tweetData['replyingTo']}</i></blockquote>"
|
content += f"<blockquote>↪️ <i>Replying to @{tweetData['replyingTo']}</i></blockquote>"
|
||||||
|
|
||||||
mainText = tweetData['text']
|
mainText = html.escape(tweetData['text'])
|
||||||
if tweetData["translation"] is not None:
|
if tweetData["translation"] is not None:
|
||||||
content += f"<blockquote>🌐 <i>{tweetData['translation']['source_language'].upper()}→{tweetData['translation']['destination_language'].upper()}</i></blockquote>"
|
content += f"<blockquote>🌐 <i>{tweetData['translation']['source_language'].upper()}→{tweetData['translation']['destination_language'].upper()}</i></blockquote>"
|
||||||
mainText=tweetData['translation']["text"]
|
mainText=html.escape(tweetData['translation']["text"])
|
||||||
|
|
||||||
content+=f"<p>{mainText}</p>"
|
content+=f"<p>{mainText}</p>"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user