From 7f150f90ff335da6e1dd49010d9a26ff93cff269 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Mon, 19 Feb 2018 05:06:29 +0000 Subject: md_tw.py: Add TWMarkdown._remove_prefix. * md_tw.py (TWMarkdown)[_remove_prefix]: New method. --- md_tw.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/md_tw.py b/md_tw.py index 5492d6a..8890e70 100644 --- a/md_tw.py +++ b/md_tw.py @@ -331,6 +331,14 @@ class TWMarkdown(mistune.Markdown): if subseq: self.renderer.tw_set(subsequent_indent=p) + def _remove_prefix(self, length, initial=True, subseq=True): + p = self.renderer.tw_get('initial_indent')[:-length] + + 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 '> ' prefix = self.renderer.tw_get('initial_indent') + '> ' -- cgit v1.2.3