From 5a56138e5524dad5a415b9281eff63c400055fd8 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Mar 2022 19:36:30 +0100 Subject: [PATCH] PDF tables: fix mix tags/Platypus markup --- app/scodoc/gen_tables.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/scodoc/gen_tables.py b/app/scodoc/gen_tables.py index 72326132..0a4b65ca 100644 --- a/app/scodoc/gen_tables.py +++ b/app/scodoc/gen_tables.py @@ -63,12 +63,15 @@ from app.scodoc.sco_pdf import SU from app import log -def mark_paras(L, tags): - """Put each (string) element of L between """ +def mark_paras(L, tags) -> list[str]: + """Put each (string) element of L between ..., + for each supplied tag. + Leave non string elements untouched. + """ for tag in tags: - b = "<" + tag + ">" - c = "" - L = [b + (x or "") + c for x in L] + start = "<" + tag + ">" + end = "" + L = [(start + (x or "") + end) if isinstance(x, str) else x for x in L] return L