From 54dd263be1ab436bf55027b469f77e40cf155997 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 25 Apr 2009 09:23:44 -0700 Subject: [PATCH] IGN:Fix bug in anchor insertion routine where it was inserting an anchor in the wrong place --- src/calibre/ebooks/mobi/reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index d217f5be6a..1f84c4f5d4 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -587,7 +587,8 @@ class MobiReader(object): if r > -1 and (r < l or l == end or l == -1): p = self.mobi_html.rfind('<', 0, end + 1) if pos < end and p > -1 and \ - not end_tag_re.match(self.mobi_html[p:r]): + not end_tag_re.match(self.mobi_html[p:r]) and \ + not self.mobi_html[p:r+1].endswith('/>'): anchor = ' filepos-id="filepos%d"' end = r else: