IGN:Tag release

This commit is contained in:
Kovid Goyal 2010-06-04 18:50:11 -06:00
parent 7d7091ccc3
commit 60369e8677
3 changed files with 641 additions and 479 deletions

View File

@ -44,7 +44,8 @@ def get_metadata_(src, encoding=None):
author = match.group(2).replace(',', ';') author = match.group(2).replace(',', ';')
ent_pat = re.compile(r'&(\S+)?;') ent_pat = re.compile(r'&(\S+)?;')
title = ent_pat.sub(entity_to_unicode, title) if title:
title = ent_pat.sub(entity_to_unicode, title)
if author: if author:
author = ent_pat.sub(entity_to_unicode, author) author = ent_pat.sub(entity_to_unicode, author)
mi = MetaInformation(title, [author] if author else None) mi = MetaInformation(title, [author] if author else None)

View File

@ -201,7 +201,11 @@ class CSSFlattener(object):
tag = barename(node.tag) tag = barename(node.tag)
style = stylizer.style(node) style = stylizer.style(node)
cssdict = style.cssdict() cssdict = style.cssdict()
font_size = style['font-size'] try:
font_size = style['font-size']
except:
font_size = self.sbase if self.sbase is not None else \
self.context.source.fbase
if 'align' in node.attrib: if 'align' in node.attrib:
cssdict['text-align'] = node.attrib['align'] cssdict['text-align'] = node.attrib['align']
del node.attrib['align'] del node.attrib['align']

File diff suppressed because it is too large Load Diff