summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Meister <devnull@localhost>2013-03-11 20:31:26 +0100
committerRoland Meister <devnull@localhost>2013-03-11 20:31:26 +0100
commit6ac4b8df6cf76a39d16100953e32d651c585e07f (patch)
tree1e6a269d7f0708cf65249969994242ee38c1f2b5
parentd5799a2016c077b8ddd0225d97ea7a06e93198e2 (diff)
downloadsphinx-6ac4b8df6cf76a39d16100953e32d651c585e07f.tar.gz
Code cleanup: remove redundant check; move uri formatting into branch.
-rw-r--r--sphinx/builders/epub.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py
index 6f8d9dae..644ada92 100644
--- a/sphinx/builders/epub.py
+++ b/sphinx/builders/epub.py
@@ -295,13 +295,12 @@ class EpubBuilder(StandaloneHTMLBuilder):
uri = node.get('refuri', '')
if (uri.startswith('http:') or uri.startswith('https:') or
uri.startswith('ftp:')) and uri not in node.astext():
- uri = _link_target_template % {'uri': uri}
- if uri:
- idx = node.parent.index(node) + 1
- if show_urls == 'inline':
- link = nodes.inline(uri, uri)
- link['classes'].append(_css_link_target_class)
- node.parent.insert(idx, link)
+ idx = node.parent.index(node) + 1
+ if show_urls == 'inline':
+ uri = _link_target_template % {'uri': uri}
+ link = nodes.inline(uri, uri)
+ link['classes'].append(_css_link_target_class)
+ node.parent.insert(idx, link)
def write_doc(self, docname, doctree):
"""Write one document file.