pcback commited on
Commit
76f6ada
·
1 Parent(s): 08161c3

Fix html escape

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -14,6 +14,7 @@ import pytesseract
14
  from pytesseract import Output
15
 
16
  from bs4 import BeautifulSoup as bs
 
17
 
18
  import sys, json
19
 
@@ -202,7 +203,7 @@ def cells_to_html(cells):
202
  for cell in r_cells:
203
  rowspan = cell['row_nums'][-1] - cell['row_nums'][0] + 1
204
  colspan = cell['column_nums'][-1] - cell['column_nums'][0] + 1
205
- r_html += f'<td rowspan="{rowspan}" colspan="{colspan}">{cell["text"]}</td>'
206
  html_code += f'<tr>{r_html}</tr>'
207
  html_code = '''<html>
208
  <head>
 
14
  from pytesseract import Output
15
 
16
  from bs4 import BeautifulSoup as bs
17
+ from html import escape
18
 
19
  import sys, json
20
 
 
203
  for cell in r_cells:
204
  rowspan = cell['row_nums'][-1] - cell['row_nums'][0] + 1
205
  colspan = cell['column_nums'][-1] - cell['column_nums'][0] + 1
206
+ r_html += f'<td rowspan="{rowspan}" colspan="{colspan}">{escape(cell["text"])}</td>'
207
  html_code += f'<tr>{r_html}</tr>'
208
  html_code = '''<html>
209
  <head>