""" import preprocessors import blockprocessors import treeprocessors import inlinepatterns import postprocessors import blockparser import etree_loader import odict # Extensions should use "markdown.etree" instead of "etree" (or do `from # markdown import etree`). Do not import it by yourself. etree = etree_loader.importETree() # Adds the ability to output html4 import html4 class Markdown: """Convert Markdown to HTML.""" def __init__(self, extensions=[], extension_configs={}, safe_mode = False, output_format=DEFAULT_OUTPUT_FORMAT): """ Creates a new Markdown instance.
#Embedded file name: markdown\util.py import re from logging import CRITICAL import etree_loader BLOCK_LEVEL_ELEMENTS = re.compile('^(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|hr|hr/|style|li|dt|dd|thead|tbody|tr|th|td|section|footer|header|group|figure|figcaption|aside|article|canvas|output|progress|video)$', re.IGNORECASE) STX = u'\x02' ETX = u'\x03' INLINE_PLACEHOLDER_PREFIX = STX + 'klzzwxh:' INLINE_PLACEHOLDER = INLINE_PLACEHOLDER_PREFIX + '%s' + ETX INLINE_PLACEHOLDER_RE = re.compile(INLINE_PLACEHOLDER % '([0-9]{4})') AMP_SUBSTITUTE = STX + 'amp' + ETX RTL_BIDI_RANGES = ((u'\u0590', u'\u07ff'), (u'\u2d30', u'\u2d7f')) etree = etree_loader.importETree() def isBlockLevel(tag): """Check if the tag is a block level HTML tag.""" if isinstance(tag, basestring): return BLOCK_LEVEL_ELEMENTS.match(tag) return False class AtomicString(unicode): """A string which should not be further processed.""" pass class Processor: def __init__(self, markdown_instance = None): if markdown_instance: self.markdown = markdown_instance