This commit is contained in:
Kovid Goyal 2011-11-10 18:58:55 +05:30
parent 17fb07e8aa
commit 1198aaee3c

View File

@ -101,15 +101,15 @@ class LoadParser(handler.ContentHandler):
self.level = self.level - 1 self.level = self.level - 1
# Changed by Kovid to deal with <span> tags with only whitespace # Changed by Kovid to deal with <span> tags with only whitespace
# content. # content.
data = ''.join(self.data) data = q = ''.join(self.data)
tn = getattr(self.curr, 'tagName', '') tn = getattr(self.curr, 'tagName', '')
try: try:
do_strip = not tn.startswith('text:') do_strip = not tn.startswith('text:')
except: except:
do_strip = True do_strip = True
if do_strip: if do_strip:
data = data.strip() q = q.strip()
if data: if q:
self.curr.addText(data, check_grammar=False) self.curr.addText(data, check_grammar=False)
self.data = [] self.data = []
self.curr = self.curr.parentNode self.curr = self.curr.parentNode