Fix text paragraph separation.
This commit is contained in:
parent
18ceb6bca5
commit
2b18c6a9b3
2 changed files with 12 additions and 3 deletions
|
@ -299,14 +299,16 @@ def render_results_block(element, acc):
|
|||
|
||||
|
||||
def render_text(element, acc):
|
||||
acc.append('<span class="text">')
|
||||
acc.append('<div class="text">')
|
||||
render_text_tokens(element.content, acc)
|
||||
acc.append('</span>')
|
||||
acc.append('</div>')
|
||||
|
||||
def render_text_tokens(tokens, acc):
|
||||
acc.append('<p>')
|
||||
for chunk in tokens:
|
||||
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):
|
||||
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('</p>')
|
||||
|
||||
|
||||
def render_tag(element, acc):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue