From 7f1a54dbd1e802d0da1a3ce43eb8124420a9485e Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Tue, 6 Mar 2007 04:21:59 +0000 Subject: [PATCH] src/plugins/NarrativeWeb.py: Fix 0000954: e-mail address causes Narrative Web plugin to generate bad links svn: r8273 --- ChangeLog | 4 ++++ src/plugins/NarrativeWeb.py | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 14ac3ced5..722631cca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-03-05 Brian Matherly + * src/plugins/NarrativeWeb.py: Fix 0000954: e-mail address causes Narrative + Web plugin to generate bad links + 2007-03-05 Brian Matherly * src/plugins/GraphViz.py: Fix 0000942: Relationship graph doesn't show preferred name format diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index 9679d9ac5..870922e10 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -459,7 +459,14 @@ class BasePage: if not descr: descr = uri of.write('%d.' % index) - of.write('%s' % (uri,descr)) + if url.get_type() == RelLib.UrlType.EMAIL and not uri.startswith("mailto:"): + of.write('%s' % (uri,descr)) + elif url.get_type() == RelLib.UrlType.WEB_HOME and not uri.startswith("http://"): + of.write('%s' % (uri,descr)) + elif url.get_type() == RelLib.UrlType.WEB_FTP and not uri.startswith("ftp://"): + of.write('%s' % (uri,descr)) + else: + of.write('%s' % (uri,descr)) of.write('\n') index = index + 1 of.write('\n')