1
0
forked from ScoDoc/ScoDoc

PDF tables: fix mix tags/Platypus markup

This commit is contained in:
Emmanuel Viennet 2022-03-10 19:36:30 +01:00
parent 462c084bf4
commit 5a56138e55

View File

@ -63,12 +63,15 @@ from app.scodoc.sco_pdf import SU
from app import log from app import log
def mark_paras(L, tags): def mark_paras(L, tags) -> list[str]:
"""Put each (string) element of L between <b>""" """Put each (string) element of L between <tag>...</tag>,
for each supplied tag.
Leave non string elements untouched.
"""
for tag in tags: for tag in tags:
b = "<" + tag + ">" start = "<" + tag + ">"
c = "</" + tag.split()[0] + ">" end = "</" + tag.split()[0] + ">"
L = [b + (x or "") + c for x in L] L = [(start + (x or "") + end) if isinstance(x, str) else x for x in L]
return L return L