From 2b18c6a9b32373038be85e2078fa3ec52488cfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Sat, 20 Aug 2022 17:51:08 +0200 Subject: [PATCH] Fix text paragraph separation. --- scripts/generate.py | 9 ++++++--- static/style.css | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/generate.py b/scripts/generate.py index a42a607..b87c5dd 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -299,14 +299,16 @@ def render_results_block(element, acc): def render_text(element, acc): - acc.append('') + acc.append('
') render_text_tokens(element.content, acc) - acc.append('') + acc.append('
') def render_text_tokens(tokens, acc): + acc.append('

') for chunk in tokens: if isinstance(chunk, str): - acc.append('{} '.format(chunk)) + lines = chunk.replace('\n\n', '

') + acc.append('{}'.format(lines)) elif isinstance(chunk, Link): link_target = chunk.value if link_target.startswith('id:'): @@ -321,6 +323,7 @@ def render_text_tokens(tokens, acc): )) # else: # raise NotImplementedError('TextToken: {}'.format(chunk)) + acc.append('

') def render_tag(element, acc): diff --git a/static/style.css b/static/style.css index 1829181..e864102 100644 --- a/static/style.css +++ b/static/style.css @@ -29,6 +29,12 @@ html, body { content: "🮦"; } +/* Inhibit

tags inside items */ +/* TODO: Remove need for this on generator */ +.item p { + display: inline; +} + /* Headers */ h1 { font-size: 150%;