diff --git a/pelican/readers.py b/pelican/readers.py index 067bbb85..c230a214 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -302,16 +302,18 @@ class HTMLReader(BaseReader): return result + '>' def _handle_meta_tag(self, attrs): - name = self._attr_value(attrs, 'name').lower() - contents = self._attr_value(attrs, 'content', '') - if not contents: - contents = self._attr_value(attrs, 'contents', '') - if contents: - logger.warning("Meta tag attribute 'contents' used in file %s, should be changed to 'content'", self._filename) + name = self._attr_value(attrs, 'name') + if name: + name = name.lower() + contents = self._attr_value(attrs, 'content', '') + if not contents: + contents = self._attr_value(attrs, 'contents', '') + if contents: + logger.warning("Meta tag attribute 'contents' used in file %s, should be changed to 'content'", self._filename) - if name == 'keywords': - name = 'tags' - self.metadata[name] = contents + if name == 'keywords': + name = 'tags' + self.metadata[name] = contents @classmethod def _attr_value(cls, attrs, name, default=None): diff --git a/pelican/tests/content/article_with_metadata_and_contents.html b/pelican/tests/content/article_with_metadata_and_contents.html index b108ac8a..5bd9f16d 100644 --- a/pelican/tests/content/article_with_metadata_and_contents.html +++ b/pelican/tests/content/article_with_metadata_and_contents.html @@ -7,6 +7,7 @@ + Multi-line metadata should be supported