Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
markdown
/
extensions
/
File Content:
extra.pyc
� �(�Sc @@ s� d Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l Z d d d d d d d g Z d e f d � � YZ i d � Z d e f d � � YZ d S( u� Python-Markdown Extra Extension =============================== A compilation of various Python-Markdown extensions that imitates [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). Note that each of the individual extensions still need to be available on your PYTHONPATH. This extension simply wraps them all up as a convenience so that only one extension needs to be listed when initiating Markdown. See the documentation for each individual extension for specifics about that extension. In the event that one or more of the supported extensions are not available for import, Markdown will issue a warning and simply continue without that extension. There may be additional extensions that are distributed with Python-Markdown that are not included here in Extra. Those extensions are not part of PHP Markdown Extra, and therefore, not part of Python-Markdown Extra. If you really would like Extra to include additional extensions, we suggest creating your own clone of Extra under a differant name. You could also edit the `extensions` global variable defined below, but be aware that such changes may be lost when you upgrade to any future version of Python-Markdown. i ( t absolute_import( t unicode_literalsi ( t Extensioni ( t BlockProcessor( t utilNu smart_strongu fenced_codeu footnotesu attr_listu def_listu tablesu abbrt ExtraExtensionc B@ s e Z d Z d � Z RS( u* Add various extensions to Markdown class.c C@ s� | j t | j � | j s~ t | j d _ | j j j d t | j � d � d | j j _ t j d t j � | j j _ n d S( u Register extension instances. u html_blocku markdown_blocku _begini����u* ^(p|h[1-6]|li|dd|dt|td|th|legend|address)$N( t registerExtensionst extensionst configt safeModet Truet preprocessorst markdown_in_rawt parsert blockprocessorst addt MarkdownInHtmlProcessort tag_countert ret compilet IGNORECASEt contain_span_tags( t selft mdt md_globals( ( s= /usr/lib/python2.7/site-packages/markdown/extensions/extra.pyt extendMarkdown1 s ( t __name__t __module__t __doc__R ( ( ( s= /usr/lib/python2.7/site-packages/markdown/extensions/extra.pyR . s c C@ s t d t | � � S( Nt configs( R t dict( R ( ( s= /usr/lib/python2.7/site-packages/markdown/extensions/extra.pyt makeExtension? s R c B@ s/ e Z d Z d � Z d � Z d e d � Z RS( u$ Process Markdown Inside HTML Blocks.c C@ s$ | t j t | j j j d � k S( Ni ( R t TAG_PLACEHOLDERt strR R R ( R t parentt block( ( s= /usr/lib/python2.7/site-packages/markdown/extensions/extra.pyt testE s c C@ s g } | j j j d } xm t | j � | k r� | j | d r� | j | d } | j | d } | j | d | f � | d 7} q WxT t | d � D]B \ } \ } } | j | | | | !| | | | d d !t � q� W| j | | | d d | d d !| | d d t � d S( u1 Process the element's child elements in self.run.i u left_indexu right_indexi����i N( R R R t lent _tag_datat appendt enumeratet runR ( R t elementR# t nest_indext it left_child_indext right_child_indext left_indext right_index( ( s= /usr/lib/python2.7/site-packages/markdown/extensions/extra.pyt _process_nestsI s )#!#c C@ s� | j j j j | _ | j j j d 7_ | j | j j j } | d j d � } t j j | | d | d � } | r� | j j | | � | d } n$ | | d d | d !} | | d 4| j j j j | d � r� | d k s� | d k rd j | � | _ n� | j j j d } t | j � | k r�| j | d r�| j | d d } | j j | | | � | s�| j | | � } q�n | j j | | � d S( Ni u attrsu markdownu tagu left_indexu right_indexu blocku spanu ( R t markdownt htmlStasht tag_dataR&