From 9be54dc3682a29377bb78e0a29e015e4cd8363cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 19 Jun 2012 23:35:42 +0200 Subject: [PATCH] fix heading formatting --- text_dokuwiki.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/text_dokuwiki.py b/text_dokuwiki.py index 5c91a79..7454d66 100644 --- a/text_dokuwiki.py +++ b/text_dokuwiki.py @@ -142,13 +142,13 @@ class Formatter(FormatterBase): return ['\n', '\\\n'][not preformatted] def heading(self, on, depth, **kw): + # heading depth reversed in dokuwiki + heading_depth = 7 - depth + if on: - self._text = [] - return '\n\n' + return u'%s ' % (u'=' * heading_depth) else: - result = u'\n%s\n\n' % (u'=' * len("".join(self._text))) - self._text = None - return result + return u' %s' % (u'=' * heading_depth) def table(self, on, attrs={}, **kw): return ['', '
'][not on]