From c01500ce19b17d132c0aadda445d1bb12d25c5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 6 Feb 2011 23:34:39 +0200 Subject: [PATCH] support languages with code blocks; link file:// protocol --- moin2doku.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/moin2doku.py b/moin2doku.py index 4d33ef1..f367a22 100755 --- a/moin2doku.py +++ b/moin2doku.py @@ -144,13 +144,20 @@ def convert_markup(content, filename): ('(\[\[.+\]\]).*\]', '\\1'), # web link without title - ('\[(http[^\s]+)\]', '[[\\1]]'), + ('\[((?:http|https|file)[^\s]+)\]', '[[\\1]]'), # web link with title - ('\[(http[^\s]+)\s+(.+?)\]', '[[\\1|\\2]]'), + ('\[((?:http|https|file)[^\s]+)\s+(.+?)\]', '[[\\1|\\2]]'), ('\["/(.*)"\]', '[['+filename[-1]+':\\1]]'), - ('\{{3}', '<'+'code>'), # code open - ('\}{3}', '<'+'/code>'), # code close + + # code blocks + # open and language + ('\{{3}#!(python|php)', '<'+'code \\1>'), + # code open + ('\{{3}', '<'+'code>'), + # close + ('\}{3}', '<'+'/code>'), + ('^\s\s\s\s\*', ' *'), ('^\s\s\s\*', ' *'), ('^\s\s\*', ' *'),