Skip to content

Commit

Permalink
quick fix for #95
Browse files Browse the repository at this point in the history
  • Loading branch information
wo committed Sep 25, 2016
1 parent 8e7f80c commit 4ba1dc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ def html_context(self):
if len(el._text) - len(self.element._text) < 5:
par._outerHTML = par.get_attribute('outerHTML')
el._outerHTML = el.get_attribute('outerHTML')
l,r = par._outerHTML.split(el._outerHTML, 1)
try:
l,r = par._outerHTML.split(el._outerHTML, 1)
except ValueError: # no split, what now?
return el._text
if re.search(r'\w\s*$', l) or re.search(r'^\s*\w', r):
debug(5, 'argh: case (3)')
for pat in (r'<h\d.*?>', r'<br>\s*<br>', r'<br>'):
Expand Down

0 comments on commit 4ba1dc7

Please sign in to comment.