Fix regression that broke html metadata

HTML Input: Fix a regression that broke processing of HTML files
that contain meta tags with dc: namespaced attribute values.
This commit is contained in:
Kovid Goyal 2013-09-19 09:04:02 +05:30
parent 4e35050879
commit 5d09bc1f79

View File

@ -69,7 +69,15 @@ def parse_meta_tags(src):
'<meta\s+%s\s+%s' % (cpat, npat),
):
for match in re.finditer(pat, src, flags=re.IGNORECASE):
field = rmap[match.group('name').lower()]
x = match.group('name').lower()
try:
field = rmap[x]
except KeyError:
try:
field = rmap[x.replace(':', '.')]
except KeyError:
continue
if field not in ans:
ans[field] = replace_entities(match.group('content'))
if len(ans) == len(META_NAMES):