diff --git a/databook_utils/insert_authors_version.py b/databook_utils/insert_authors_version.py index 6e99b1a1..01a90e9e 100644 --- a/databook_utils/insert_authors_version.py +++ b/databook_utils/insert_authors_version.py @@ -133,7 +133,16 @@ def run(self): line_block = nodes.line_block() for property in properties[1:]: - if property != "": + if not property: + continue + elif property.startswith("https://") or property.startswith("http://"): + link_node = nodes.reference(text=property, refuri=property) + line_block.append(link_node) + elif "@" in property: + mailto_link = f"mailto:{property}" + email_node = nodes.reference(text=property, refuri=mailto_link) + line_block.append(email_node) + else: line_block.append(nodes.line(text=property)) line_block.append(nodes.line(text="")) @@ -153,4 +162,4 @@ def setup(app): 'version': '0.1', 'parallel_read_safe': True, 'parallel_write_safe': True, - } \ No newline at end of file + }