sane_lists
Sane List Extension for Python-Markdown.
Modify the behavior of Lists in Python-Markdown to act in a sane manor.
See https://pythonhosted.org/Markdown/extensions/sane_lists.html for documentation.
Original code Copyright 2011 Waylan Limberg
All changes Copyright 2011-2014 The Python Markdown Project
License: BSD
Classes
SaneOListProcessor(parser)
Bases: OListProcessor
Sane ordered list processor.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/sane_lists.py
Attributes
parser = parser
instance-attribute
tab_length = parser.markdown.tab_length
instance-attribute
TAG = 'ol'
class-attribute
instance-attribute
STARTSWITH = '1'
class-attribute
instance-attribute
RE = re.compile('^[ ]{0,%d}\\d+\\.[ ]+(.*)' % self.tab_length - 1)
instance-attribute
INDENT_RE = re.compile('^[ ]{%d,%d}((\\d+\\.)|[*+-])[ ]+.*' % (self.tab_length, self.tab_length * 2 - 1))
instance-attribute
SIBLING_TAGS = ['ol']
class-attribute
instance-attribute
CHILD_RE = re.compile('^[ ]{0,%d}((\\d+\\.))[ ]+(.*)' % self.tab_length - 1)
instance-attribute
Functions
lastChild(parent)
detab(text)
Remove a tab from the front of each line of the given text.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
looseDetab(text, level=1)
Remove a tab from front of lines but allowing dedented lines.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
test(parent, block)
run(parent, blocks)
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
get_items(block)
Break a block into list items.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
SaneUListProcessor(parser)
Bases: UListProcessor
Sane unordered list processor.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/sane_lists.py
Attributes
parser = parser
instance-attribute
tab_length = parser.markdown.tab_length
instance-attribute
TAG = 'ul'
class-attribute
instance-attribute
STARTSWITH = '1'
class-attribute
instance-attribute
RE = re.compile('^[ ]{0,%d}[*+-][ ]+(.*)' % self.tab_length - 1)
instance-attribute
INDENT_RE = re.compile('^[ ]{%d,%d}((\\d+\\.)|[*+-])[ ]+.*' % (self.tab_length, self.tab_length * 2 - 1))
instance-attribute
SIBLING_TAGS = ['ul']
class-attribute
instance-attribute
CHILD_RE = re.compile('^[ ]{0,%d}(([*+-]))[ ]+(.*)' % self.tab_length - 1)
instance-attribute
Functions
lastChild(parent)
detab(text)
Remove a tab from the front of each line of the given text.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
looseDetab(text, level=1)
Remove a tab from front of lines but allowing dedented lines.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
test(parent, block)
run(parent, blocks)
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
get_items(block)
Break a block into list items.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
SaneListExtension(*args, **kwargs)
Bases: Extension
Add sane lists to Markdown.
Initiate Extension and set up configs.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/__init__.py
Attributes
config = {}
class-attribute
instance-attribute
Functions
getConfig(key, default='')
Return a setting for the given key or an empty string.
getConfigs()
getConfigInfo()
setConfig(key, value)
Set a config setting for key
with the given value
.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/__init__.py
setConfigs(items)
Set multiple config settings given a dict or list of tuples.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/__init__.py
extendMarkdown(md, md_globals)
Override existing Processors.