Skip to content

Commit 43bd2ad

Browse files
authored
fix: table recognition content is not escaped properly (#13277)
1 parent 7a3c580 commit 43bd2ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ppstructure/table/matcher.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import numpy as np
1616
from ppstructure.table.table_master_match import deal_eb_token, deal_bb
17+
import html
1718

1819

1920
def distance(box_1, box_2):
@@ -133,6 +134,8 @@ def get_pred_html(self, pred_structures, matched_index, ocr_contents):
133134
and " " != content[-1]
134135
):
135136
content += " "
137+
# escape content
138+
content = html.escape(content)
136139
end_html.extend(content)
137140
if b_with:
138141
end_html.extend("</b>")

0 commit comments

Comments
 (0)