diff options
author | Roland Meister <devnull@localhost> | 2013-03-11 20:31:26 +0100 |
---|---|---|
committer | Roland Meister <devnull@localhost> | 2013-03-11 20:31:26 +0100 |
commit | 6ac4b8df6cf76a39d16100953e32d651c585e07f (patch) | |
tree | 1e6a269d7f0708cf65249969994242ee38c1f2b5 | |
parent | d5799a2016c077b8ddd0225d97ea7a06e93198e2 (diff) | |
download | sphinx-6ac4b8df6cf76a39d16100953e32d651c585e07f.tar.gz |
Code cleanup: remove redundant check; move uri formatting into branch.
-rw-r--r-- | sphinx/builders/epub.py | 13 |
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. |