From 3e00a310410d5146da2e0d8e9efc3634d57d656b Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Wed, 18 May 2022 07:22:53 +0200 Subject: [PATCH] Corrected a couple of typos and left some todo --- src/bootstraparse/modules/export.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bootstraparse/modules/export.py b/src/bootstraparse/modules/export.py index 3709a97..e5c5682 100644 --- a/src/bootstraparse/modules/export.py +++ b/src/bootstraparse/modules/export.py @@ -1,5 +1,4 @@ # Module for final generation of the translated website - from bootstraparse.modules import config, pathresolver, error_mngr from collections import namedtuple @@ -23,13 +22,15 @@ def format_optionals(optionals): on one hand and var on the other hand. rtype: str """ - if optionals != '': - h, c = optionals.content.html_insert, optionals.content.class_insert + if optionals: + h, c = optionals.content.html_insert, optionals.content.class_insert # TODO : Simplify this else: return '' if h != '': h = h.content.html_insert - output = f'''{' '.join(h)}{' ' if h and c else ''}{f'class="{c}"' if c else ''}''' + if c != '': + c = " ".join(c.content.class_insert) # TODO : Simplify this (sic.) + output = f'''{' '.join(h)}{' ' if h and c else ''}{f'class="{c}"' if c else ''}''' # The inconsistency is here with " and ' return output