Spaces:
Running
Running
Commit
·
672a01e
1
Parent(s):
b90a3da
Enhance title handling in main.py with HTML escaping for improved safety
Browse files
main.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import json
|
2 |
import os
|
3 |
import dotenv
|
|
|
4 |
from summarize_paper import summarize_paper
|
5 |
from fetch_data import fetch_paper_data_with_category
|
6 |
from post_blog import post_blog
|
@@ -29,7 +30,7 @@ def paper_data(paper_data, wait_time=5):
|
|
29 |
print(f"Skipping paper with ID: {paper_id} (summary/mindmap not found)")
|
30 |
continue
|
31 |
try:
|
32 |
-
title = title.encode('unicode-escape').decode().replace('\\\\', '\\')
|
33 |
summary = summary.encode('unicode-escape').decode().replace('\\\\', '\\')
|
34 |
mindmap = mindmap.encode('unicode-escape').decode().replace('\\\\', '\\')
|
35 |
citation = citation.encode('unicode-escape').decode().replace('\\\\', '\\')
|
|
|
1 |
import json
|
2 |
import os
|
3 |
import dotenv
|
4 |
+
import html
|
5 |
from summarize_paper import summarize_paper
|
6 |
from fetch_data import fetch_paper_data_with_category
|
7 |
from post_blog import post_blog
|
|
|
30 |
print(f"Skipping paper with ID: {paper_id} (summary/mindmap not found)")
|
31 |
continue
|
32 |
try:
|
33 |
+
title = html.escape(title.encode('unicode-escape').decode().replace('\\\\', '\\'))
|
34 |
summary = summary.encode('unicode-escape').decode().replace('\\\\', '\\')
|
35 |
mindmap = mindmap.encode('unicode-escape').decode().replace('\\\\', '\\')
|
36 |
citation = citation.encode('unicode-escape').decode().replace('\\\\', '\\')
|