diff options
author | rsiddharth <s@ricketyspace.net> | 2018-02-18 20:40:13 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-02-18 20:40:13 +0000 |
commit | 025be1b9277d3c814c318ffbecfb9e30f2265c34 (patch) | |
tree | a85e7c8ef00dd915a6c4bbc527e7a2de4f2e6901 | |
parent | 6d34500e55eb225a89d26ed7606a772c638b6984 (diff) |
md_tw.py: Add TWRenderer.block_html.
* md_tw.py (TWRenderer)[block_html]: New method.
-rw-r--r-- | md_tw.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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()) |