Log a warning when the HTML reader encounters a nonconformant meta tag

Instead of throwing an exception and skipping the HTML file, log a
warning with a message which makes it more obvious as to what happened.
This commit is contained in:
Mark Lee 2013-11-08 14:37:07 -08:00
commit 35375b19ff
4 changed files with 29 additions and 1 deletions

View file

@ -384,3 +384,13 @@ class HTMLReaderTest(ReaderTest):
self.assertIn('category', page.metadata, 'Key should be lowercase.')
self.assertEqual('Yeah', page.metadata.get('category'),
'Value keeps cases.')
def test_article_with_nonconformant_meta_tags(self):
page = self.read_file(path='article_with_nonconformant_meta_tags.html')
expected = {
'summary': 'Summary and stuff',
'title': 'Article with Nonconformant HTML meta tags',
}
for key, value in expected.items():
self.assertEqual(value, page.metadata[key], key)