Add links in text.
This commit is contained in:
parent
09cfed5fdd
commit
c86ec3fc9b
@ -7,7 +7,7 @@ import sys
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from org_rw import OrgTime, dom
|
||||
from org_rw import OrgTime, dom, Link
|
||||
from org_rw import dump as dump_org
|
||||
from org_rw import load as load_org
|
||||
from org_rw import token_list_to_raw
|
||||
@ -137,8 +137,14 @@ def render_code_block(element, acc):
|
||||
|
||||
|
||||
def render_text(element, acc):
|
||||
for chunk in element.content.contents:
|
||||
acc.append('<span class="text">{}</span> '.format(chunk))
|
||||
for chunk in element.content:
|
||||
if isinstance(chunk, str):
|
||||
acc.append('<span class="text">{}</span> '.format(chunk))
|
||||
elif isinstance(chunk, Link):
|
||||
# @TODO: URLEscape
|
||||
acc.append('<a href="{}">{}</a>'.format(chunk.value, chunk.description))
|
||||
else:
|
||||
raise NotImplemented()
|
||||
|
||||
|
||||
def render_tag(element, acc):
|
||||
|
Loading…
Reference in New Issue
Block a user