use bs4 for pre2br; fix style sheet for tables

Also: load default.css from the actual file if the package is not
zipped.
This commit is contained in:
Mathieu PATUREL
2017-01-26 10:36:52 +11:00
parent bad1cb74c6
commit 48c1800065
5 changed files with 24 additions and 5 deletions

View File

@ -53,7 +53,7 @@ def pre_table(s_table):
for i, cell in enumerate(row):
if cols_width[i] < len(cell.text):
cols_width[i] = len(cell.text)
text = '<pre><code>'
text = '<pre class="table"><code>'
for i, row in enumerate(rows):
for j, cell in enumerate(row):
text += '| ' + ''.join(str(node) for node in cell.contents) + ' ' * (cols_width[j] - len(cell.text))