Support ID links.

This commit is contained in:
Sergio Martínez Portela 2022-05-06 21:18:16 +02:00
parent 8295154a96
commit 2c6d54d9ed

View File

@ -147,7 +147,10 @@ def render_text_tokens(tokens, acc):
acc.append('{}</span> '.format(chunk))
elif isinstance(chunk, Link):
# @TODO: URLEscape
acc.append('<a href="{}">{}</a>'.format(chunk.value, chunk.description))
link_target = chunk.value
if link_target.startswith('id:'):
link_target = './' + link_target[3:] + '.node.html'
acc.append('<a href="{}">{}</a>'.format(link_target, chunk.description))
else:
raise NotImplementedError('TextToken: {}'.format(chunk))