From 025be1b9277d3c814c318ffbecfb9e30f2265c34 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 18 Feb 2018 20:40:13 +0000 Subject: md_tw.py: Add TWRenderer.block_html. * md_tw.py (TWRenderer)[block_html]: New method. --- md_tw.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/md_tw.py b/md_tw.py index 188d205..9bc0e2f 100644 --- a/md_tw.py +++ b/md_tw.py @@ -272,6 +272,12 @@ class TWRenderer(mistune.Renderer): out = '{}'.format(text.rstrip('>\n')) return out + def block_html(self, html): + out = '{}'.format(html) + out = textwrap.indent(out, self.tw_get('initial_indent'), + lambda line: True) + return out + def paragraph(self, text): out = self._tw_fill(text) out = '{}\n{}\n'.format(out, self.tw_get('initial_indent').strip()) -- cgit v1.2.3