diff options
author | rsiddharth <s@ricketyspace.net> | 2018-02-19 05:06:29 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-02-19 05:06:29 +0000 |
commit | 7f150f90ff335da6e1dd49010d9a26ff93cff269 (patch) | |
tree | 7bba3348257e33a5673bd72e7a64e2c15ae39b2b /md_tw.py | |
parent | dc49d7128d409c7c396286f06a57611e1f5c324e (diff) |
md_tw.py: Add TWMarkdown._remove_prefix.
* md_tw.py (TWMarkdown)[_remove_prefix]: New method.
Diffstat (limited to 'md_tw.py')
-rw-r--r-- | md_tw.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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') + '> ' |