Fix text paragraph separation.

This commit is contained in:
Sergio Martínez Portela 2022-08-20 17:51:08 +02:00
parent 18ceb6bca5
commit 2b18c6a9b3
2 changed files with 12 additions and 3 deletions

View File

@ -299,14 +299,16 @@ def render_results_block(element, acc):
def render_text(element, acc): def render_text(element, acc):
acc.append('<span class="text">') acc.append('<div class="text">')
render_text_tokens(element.content, acc) render_text_tokens(element.content, acc)
acc.append('</span>') acc.append('</div>')
def render_text_tokens(tokens, acc): def render_text_tokens(tokens, acc):
acc.append('<p>')
for chunk in tokens: for chunk in tokens:
if isinstance(chunk, str): if isinstance(chunk, str):
acc.append('{}</span> '.format(chunk)) lines = chunk.replace('\n\n', '</p><p>')
acc.append('<span class="line">{}</span>'.format(lines))
elif isinstance(chunk, Link): elif isinstance(chunk, Link):
link_target = chunk.value link_target = chunk.value
if link_target.startswith('id:'): if link_target.startswith('id:'):
@ -321,6 +323,7 @@ def render_text_tokens(tokens, acc):
)) ))
# else: # else:
# raise NotImplementedError('TextToken: {}'.format(chunk)) # raise NotImplementedError('TextToken: {}'.format(chunk))
acc.append('</p>')
def render_tag(element, acc): def render_tag(element, acc):

View File

@ -29,6 +29,12 @@ html, body {
content: "🮦"; content: "🮦";
} }
/* Inhibit <p> tags inside items */
/* TODO: Remove need for this on generator */
.item p {
display: inline;
}
/* Headers */ /* Headers */
h1 { h1 {
font-size: 150%; font-size: 150%;