markdown-textwrap

text wrap markdown documents
git clone git://git.ricketyspace.net/markdown-textwrap.git
Log | Files | Refs

commit 74a49b17ab90af2fe57a1d10f12550cdca0fad4a
parent fe18c156d31a63bd1adda24c8493304aea98357b
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun,  1 Apr 2018 06:33:23 +0000

md_tw.py: Update TWRenderer.block_code.

Don't add prefix for empty lines.

* markdown_textwrap/_version.py (__version__): Update variable.
* md_tw.py (TWRenderer.block_code): Update method.

Diffstat:
markdown_textwrap/_version.py | 2+-
md_tw.py | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/markdown_textwrap/_version.py b/markdown_textwrap/_version.py @@ -18,4 +18,4 @@ # along with markdown-textwrap (see COPYING). If not, see # <http://www.gnu.org/licenses/>. -__version__ = '0.1.1' +__version__ = '0.2.0.dev' diff --git a/md_tw.py b/md_tw.py @@ -266,7 +266,7 @@ class TWRenderer(mistune.Renderer): def block_code(self, code, lang=None): out = '{}'.format(code) out = textwrap.indent(out, self.tw_get('initial_indent'), - lambda line: True) + lambda line: len(line.strip()) > 0) return out def block_quote(self, text):