\ @sdZddlmZddlmZddlmZddlmZddlZej d Z ej d Z Gd d d eZ Gd ddeZ iddZdS)aW Meta Data Extension for Python-Markdown ======================================= This extension adds Meta Data handling to markdown. Basic Usage: >>> import markdown >>> text = '''Title: A Test Doc. ... Author: Waylan Limberg ... John Doe ... Blank_Data: ... ... The body. This is paragraph one. ... ''' >>> md = markdown.Markdown(['meta']) >>> print md.convert(text)

The body. This is paragraph one.

>>> print md.Meta {u'blank_data': [u''], u'author': [u'Waylan Limberg', u'John Doe'], u'title': [u'A Test Doc.']} Make sure text without Meta Data still works (markdown < 1.6b returns a

). >>> text = ' Some Code - not extra lines of meta data.' >>> md = markdown.Markdown(['meta']) >>> print md.convert(text)

Some Code - not extra lines of meta data.
    
>>> md.Meta {} Copyright 2007-2008 [Waylan Limberg](http://achinghead.com). Project website: Contact: markdown@freewisdom.org License: BSD (see ../LICENSE.md for details) )absolute_import)unicode_literals) Extension) PreprocessorNz1^[ ]{0,3}(?P[A-Za-z0-9_-]+):\s*(?P.*)z^[ ]{4,}(?P.*)c@s"eZdZdZddZdS) MetaExtensionz* Meta-Data extension for Python-Markdown. cCs |jjdt|ddS)z, Add MetaPreprocessor to Markdown instance. meta_beginN) preprocessorsaddMetaPreprocessor)selfmd md_globalsr%build/lib/markdown/extensions/meta.pyextendMarkdown7szMetaExtension.extendMarkdownN)__name__ __module__ __qualname____doc__rrrrrr4s rc@s"eZdZdZddZdS)r z Get Meta-Data. c Csi}d}x|r |jd}|jdkr:Pntj|}|r|jdjj}|jdj}y||j|Wqtk r|g||(s