From e1d55575c3edcf2269e84915426e69ad7f26460f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Mar 2011 19:26:38 +0000 Subject: [PATCH] Fix KJ21 on BibleGateway --- openlp/plugins/bibles/lib/http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index e2dde59fd..52baab14c 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -227,6 +227,10 @@ class BGExtract(object): cleanup = [(re.compile('\s+'), lambda match: ' ')] verses = BeautifulSoup(str(soup), markupMassage=cleanup) verse_list = {} + # Cater for inconsistent mark up in the first verse of a chapter. + first_verse = verses.find(u'versenum') + if first_verse: + verse_list[1] = unicode(first_verse.contents[0]) for verse in verses(u'sup', u'versenum'): raw_verse_num = verse.next clean_verse_num = 0