diff --git a/_scripts/generate.py b/_scripts/generate.py index 731ed29..557f5d8 100644 --- a/_scripts/generate.py +++ b/_scripts/generate.py @@ -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('{} '.format(chunk)) + for chunk in element.content: + if isinstance(chunk, str): + acc.append('{} '.format(chunk)) + elif isinstance(chunk, Link): + # @TODO: URLEscape + acc.append('{}'.format(chunk.value, chunk.description)) + else: + raise NotImplemented() def render_tag(element, acc):