Update image_table.py
This commit is contained in:
parent
aa80c2090b
commit
eec737c75d
1 changed files with 3 additions and 1 deletions
|
@ -2,10 +2,12 @@ import os
|
||||||
import re
|
import re
|
||||||
import traceback
|
import traceback
|
||||||
import uuid
|
import uuid
|
||||||
|
from html import escape
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import ujson as json
|
import ujson as json
|
||||||
|
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
||||||
from config import Config
|
from config import Config
|
||||||
|
@ -32,7 +34,7 @@ async def image_table_render(table: Union[ImageTable, List[ImageTable]]):
|
||||||
for row in tbl.data:
|
for row in tbl.data:
|
||||||
cs = []
|
cs = []
|
||||||
for c in row:
|
for c in row:
|
||||||
cs.append(re.sub(r'\n', '<br>', c))
|
cs.append(escape(c))
|
||||||
d.append(cs)
|
d.append(cs)
|
||||||
w = len(tbl.headers) * 500
|
w = len(tbl.headers) * 500
|
||||||
if w > max_width:
|
if w > max_width:
|
||||||
|
|
Reference in a new issue