From 9d060c96ea471fb2651afaf75ce0b3731d728ab6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Jan 2019 11:06:50 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/widgets.py b/src/calibre/gui2/tweak_book/widgets.py index 941a03b167..05ba48c23c 100644 --- a/src/calibre/gui2/tweak_book/widgets.py +++ b/src/calibre/gui2/tweak_book/widgets.py @@ -760,7 +760,7 @@ class InsertLink(Dialog): else: target = target.split('#', 1)[0] target = self.container.href_to_name(target) - ans = ans.replace('_SOURCE_FILENAME_', self.source_name) + ans = ans.replace('_SOURCE_FILENAME_', self.source_name or '') ans = ans.replace('_DEST_FILENAME_', target or '') ans = ans.replace('_ANCHOR_', frag or '') return ans