diff --git a/scripts/generate.py b/scripts/generate.py index 0820493..e300386 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -453,16 +453,18 @@ def render_text_tokens(tokens, acc, headline, graph): for line in lines: line_chunks = [] for word in TEXT_OR_LINK_RE.findall(line): - if ':/' in word and not (word.startswith('org-protocol://')): + if '://' in word and not (word.startswith('org-protocol://')): if not (word.startswith('http://') or word.startswith('https://') or word.startswith('ftp://') or word.startswith('ftps://') ): - raise Exception('Is this a link? {} (on {})\nLine: {}\nChunks: {}'.format(word, headline.doc.path, line, chunks)) - line_chunks.append('{description}' - .format(url=word, - description=html.escape(word))) + logging.warning('Is this a link? {} (on {})\nLine: {}\nChunks: {}'.format(word, headline.doc.path, line, line_chunks)) + line_chunks.append(html.escape(word)) + else: + line_chunks.append('{description}' + .format(url=word, + description=html.escape(word))) else: line_chunks.append(html.escape(word)) contents.append(''.join(line_chunks))