Remove zero width joiner before parsing

This commit is contained in:
Hans5958 2022-04-08 11:01:51 +07:00
parent f04102f29c
commit ad15cefb07

View file

@ -89,6 +89,7 @@ def set_flair(submission, flair):
text = submission.selftext
rawtext = text
text = text.replace('\u200c', '')
text = re.compile(r".*(\{.+\}).*", re.DOTALL).search(text).group(1)
# Test if it needs to escape the escape character. Usually happens on fancy mode.
try: json.loads(text)