From 9e8e72506927c619f50b2b0369796c5dfd2da8b5 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 18 Feb 2018 19:21:00 +0000 Subject: md_tw.py: Add TWRenderer.tw_get. * md_tw.py (TWRenderer)[tw_get]: New method. --- md_tw.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/md_tw.py b/md_tw.py index 4b833ba..dbd3a44 100644 --- a/md_tw.py +++ b/md_tw.py @@ -224,6 +224,11 @@ class TWRenderer(mistune.Renderer): width=kwargs.get('tw_width', 72) ) + def tw_get(self, attr): + """Get attribute from the local textwrap.TextWrapper instance. + """ + return getattr(self.tw, attr, None) + def tw_set(self, **kwargs): """ -- cgit v1.2.3