From 7a7e135f2bb97f7cd15019a2ce401a50d9cdc78d Mon Sep 17 00:00:00 2001 From: pR0Ps Date: Fri, 26 Dec 2014 13:57:53 -0500 Subject: [PATCH] Slight optimization --- meta_yaml.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/meta_yaml.py b/meta_yaml.py index d1dfde7..2fb536f 100644 --- a/meta_yaml.py +++ b/meta_yaml.py @@ -96,14 +96,10 @@ class MetaYamlPreprocessor(Preprocessor): lines.insert(0, line) if yaml_block: meta = yaml.load("\n".join(yaml_block), Loader) - # case-insensitize meta data keys: - meta = { - k.lower(): meta[k] for k in meta - } - # PyMarkdown's Meta compat: ensure everything's a list - meta = { - k: v if isinstance(v, list) else [v] for k, v in meta.items() - } + + # Compat with PyMarkdown's meta: Keys are lowercase, values are lists + meta = {k.lower(): v if isinstance(v, list) else [v] for k, v in meta.items()} + self.markdown.Meta = meta return lines