diff options
author | rsiddharth <s@ricketyspace.net> | 2018-02-18 19:22:02 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-02-18 19:22:02 +0000 |
commit | a93933cf0aee57ed96ca68420cd2d569aff7ea5e (patch) | |
tree | d23d8fb78321386a197561b8a287c0c0cf473add | |
parent | 9e8e72506927c619f50b2b0369796c5dfd2da8b5 (diff) |
md_tw.py: Add TWRenderer.block_code.
* md_tw.py (TWRenderer)[block_code]: New method.
-rw-r--r-- | md_tw.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -256,6 +256,11 @@ class TWRenderer(mistune.Renderer): self.tw_set(**kwargs) return self.tw.fill(text) + def block_code(self, code, lang=None): + out = '{}'.format(code) + out = textwrap.indent(out, self.tw_get('initial_indent'), + lambda line: True) + return out def paragraph(self, text): wrapped = self._tw_fill(text) |