From 026dad095977c4957e85e15bc8e81a1213c04c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 20 Jun 2012 00:03:43 +0200 Subject: [PATCH] handle code blocks and hilited code blocks --- syntaxreference.txt | 16 ++++++++++++++++ text_dokuwiki.py | 14 ++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/syntaxreference.txt b/syntaxreference.txt index 130fa77..2bba841 100644 --- a/syntaxreference.txt +++ b/syntaxreference.txt @@ -12,3 +12,19 @@ Normal text, ''emphasized'', '''strong''', __underline__, ,,subscript,,, ^supers Normal text, ''emphasized'', '''strong''', __underline__, ,,subscript,,, ^superscript^, `typewriter` and {{{typewriter}}}. +== Syntax Highlighting == +{{{#!python +# python code +print code.colorize("abc", 1 + 1) +# third line +# fourth line +}}} + +{{{ +plain +multiline block +with some ''text'' in it +fourth line + +sixth line! +}}} diff --git a/text_dokuwiki.py b/text_dokuwiki.py index c4aebf1..956cdea 100644 --- a/text_dokuwiki.py +++ b/text_dokuwiki.py @@ -194,17 +194,11 @@ class Formatter(FormatterBase): return apply(FormatterBase.image, (self,), attrs) + '' def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1): - return ('' % code_id, '', '')[not on] def code_line(self, on): - return ('', '' % tok_type, '', '' % tok_type, '