From 7654eea321b123e9af6b76f0d9e708e92d9448e4 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 31 Dec 2013 21:21:37 +0100 Subject: [PATCH] [DEV] correction on the links --- codeBB/BB_Link.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/codeBB/BB_Link.py b/codeBB/BB_Link.py index 72b50d9..f7116ca 100644 --- a/codeBB/BB_Link.py +++ b/codeBB/BB_Link.py @@ -40,7 +40,7 @@ def transcode(value): r'\2', value) - value = re.sub(r'\[class\[(.*?)\]\]', + value = re.sub(r'\[(lib|class|methode)\[(.*?)\]\]', replace_link_class, value) @@ -69,9 +69,16 @@ def replace_link_class(match): if match.group() == "": return "" #debug.info("plop: " + str(match.group())) - className = match.groups()[0] - value = re.sub(':', '_', className) - return '' + className + '' + if match.groups()[0] == 'class': + className = match.groups()[1] + value = re.sub(':', '_', className) + return '' + className + '' + elif match.groups()[0] == 'lib': + return match.groups()[1] + elif match.groups()[0] == 'methode': + return match.groups()[1] + else: + return match.groups()[1]