From bae8b03c6a3879bbaadc4870e0c28ea6d6c1a2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 17 Sep 2012 00:26:47 +0200 Subject: [PATCH] process comments --- text_dokuwiki.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/text_dokuwiki.py b/text_dokuwiki.py index a8f52c4..28dee32 100644 --- a/text_dokuwiki.py +++ b/text_dokuwiki.py @@ -248,6 +248,25 @@ class Formatter(FormatterBase): # not supported return '' + def comment(self, text): + # real comments (lines with two hash marks) + if text[0:2] == '##': + return "/* %s */" % text[2:] + + # some kind of macro + tokens = text.lstrip('#').split(None, 1) + if tokens[0] in ('language'): + return '' + + if tokens[0] == 'acl': + # TODO: fill acl.auth.php + return '' + + if tokens[0] == 'pragma': + return "/* pragma: %s */" % " ".join(tokens[1:]) + + return "/* %s */" % text.lstrip('#') + def macro(self, macro_obj, name, args): def email(args): mail = args.replace(' AT ', '@')