From 3eaf3739ab959b48624b61ebe0c2ade761aa9662 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 11 Apr 2019 18:42:34 -0700 Subject: add support for PMC identifiers (like DOI) and ftp:// --- sqlite-notebook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlite-notebook.py b/sqlite-notebook.py index 3c9e72c..7f83f61 100755 --- a/sqlite-notebook.py +++ b/sqlite-notebook.py @@ -36,10 +36,12 @@ class SqliteMarkdownRenderer(mistune.Renderer): for v in row: if v is None: v = '' - if type(v) == str and (v.startswith("https://") or v.startswith("http://")): + if type(v) == str and (v.startswith("https://") or v.startswith("http://") or v.startswith("ftp://")): ret += ' {}\n'.format(v, v) elif type(v) == str and v.startswith("10."): ret += ' {}\n'.format(v, v) + elif type(v) == str and v.startswith("PMC") and v[3:].isdigit(): + ret += ' {}\n'.format(v, v) else: ret += ' {}\n'.format(v) ret += "\n" -- cgit v1.2.3