From 4e94986aa84915b8b6d6628ba91ed6f26dd065c9 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 21 Dec 2011 07:22:49 +0200 Subject: [PATCH] Fixed bug #907164: Exclude footnotes div and the comment after it. Fixes: https://launchpad.net/bugs/907164 --- openlp/plugins/bibles/lib/http.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 228d4758c..e2cbcdef0 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -92,6 +92,15 @@ class BGExtract(object): if headings: for heading in headings: heading.extract() + chapter_notes = soup.findAll('div', 'footnotes') + if chapter_notes: + log.debug('Found chapter notes') + for note in chapter_notes: + note.extract() + note_comments = soup.findAll(text=u'end of footnotes') + if note_comments: + for comment in note_comments: + comment.extract() cleanup = [(re.compile('\s+'), lambda match: ' ')] verses = BeautifulSoup(str(soup), markupMassage=cleanup) verse_list = {}