Fix ksarchive for poor summary html (copied from twcs).

This commit is contained in:
Jim Miller 2012-07-09 15:27:06 -05:00
parent f073c2543f
commit 615f7b2bc2

View file

@ -197,7 +197,13 @@ class KSArchiveComAdapter(BaseSiteAdapter): # XXX
svalue = ""
while not defaultGetattr(value,'class') == 'label':
svalue += str(value)
value = value.nextSibling
# poor HTML(unclosed <p> for one) can cause run on
# over the next label.
if '<span class="label">' in svalue:
svalue = svalue[0:svalue.find('<span class="label">')]
break
else:
value = value.nextSibling
self.setDescription(url,svalue)
#self.story.setMetadata('description',stripHTML(svalue))