From fba35555b345f335423ff48060933e4c2ba7479b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Mon, 28 Oct 2024 02:46:48 +0100 Subject: [PATCH] Handle 'uindentation' of empty texts.' --- scripts/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate.py b/scripts/generate.py index c158295..3c9252e 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -476,7 +476,7 @@ def render_block(content, acc, _class, is_code): acc.append('') def unindent(content): - base_indentation = min([ + base_indentation = min([0] + [ len(l) - len(l.lstrip(' ')) for l in content.split('\n') if len(l.strip()) > 0