summaryrefslogtreecommitdiffstats
path: root/md_tw.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2018-02-19 05:05:41 +0000
committerrsiddharth <s@ricketyspace.net>2018-02-19 05:05:41 +0000
commitdc49d7128d409c7c396286f06a57611e1f5c324e (patch)
tree61f89590fb492b0eb7bfa0a6267372055b8aa2ce /md_tw.py
parentd8385f0e38eb4cf8d26c7e8784df8243bceceaad (diff)
md_tw.py: Add TWMarkdown._add_prefix.
* md_tw.py (TWMarkdown)[_add_prefix]: New method.
Diffstat (limited to 'md_tw.py')
-rw-r--r--md_tw.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/md_tw.py b/md_tw.py
index 1d714c2..5492d6a 100644
--- a/md_tw.py
+++ b/md_tw.py
@@ -323,6 +323,13 @@ class TWMarkdown(mistune.Markdown):
# Add newline at the end.
return '{}\n'.format(out.strip('\n'))
+ def _add_prefix(self, prefix, initial=True, subseq=True):
+ p = self.renderer.tw_get('initial_indent') + prefix
+
+ if initial:
+ self.renderer.tw_set(initial_indent=p)
+ if subseq:
+ self.renderer.tw_set(subsequent_indent=p)
def output_block_quote(self):
# Set renderer to prepend '> '