From cf76cc82b24feb13ec006cb0b560b7b207e60338 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Thu, 17 Feb 2011 00:15:18 -0800 Subject: Added an alternative meta list syntax. Implicit syntax (existing): tag: Python Markdown Explicit syntax (new): tag: Python tag: Markdown These two examples are now equivalent. Previously, the latter would produce `{u'tag': [u'Markdown']}` rather than `{u'tag': [u'Python', u'Markdown']}`. --- markdown/extensions/meta.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/markdown/extensions/meta.py b/markdown/extensions/meta.py index e0c2414..8983fc8 100644 --- a/markdown/extensions/meta.py +++ b/markdown/extensions/meta.py @@ -70,7 +70,11 @@ class MetaPreprocessor(markdown.preprocessors.Preprocessor): m1 = META_RE.match(line) if m1: key = m1.group('key').lower().strip() - meta[key] = [m1.group('value').strip()] + value = m1.group('value').strip() + try: + meta[key].append(value) + except KeyError: + meta[key] = [value] else: m2 = META_MORE_RE.match(line) if m2 and key: -- cgit v1.2.3