From 47b884d9b2e3285878988ac99496c7c6a26fdceb Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 9 Dec 2013 21:38:00 +0100 Subject: [PATCH] [DEBUG] correction of the output bb code --- codeBB/BB_Code.py | 10 ++++++---- codeBB/BB_IndentAndDot.py | 8 +++++--- codeBB/BB_Link.py | 38 ++++++++++++++++++++++++++++++++--- codeBB/BB_Text.py | 42 +++++++++++++++++++++++++-------------- codeBB/BB_Title.py | 10 +++++----- codeBB/BB_comment.py | 7 ++++--- codeBB/BB_lineReturn.py | 4 ---- codeBB/codeBB.py | 2 +- lutinDoc.py | 25 +++++++++++++++++++---- lutinDocHtml.py | 23 +++++++++++++++++++-- 10 files changed, 125 insertions(+), 44 deletions(-) diff --git a/codeBB/BB_Code.py b/codeBB/BB_Code.py index 349e43c..49c311e 100644 --- a/codeBB/BB_Code.py +++ b/codeBB/BB_Code.py @@ -16,11 +16,13 @@ import re ## @return Transformed string. ## def transcode(value): + #value = re.sub(r'\[code(( |\t|\n|\r)+style=(.*))?\](.*?)\[/code\]', + value = re.sub(r'\[code(( |\t|\n|\r)+style=(.*?))?\](.*?)\[/code\]', + r'
\4
', + value, + flags=re.DOTALL) - value = re.sub(r'\[code=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]', - r'\2', - value) - + # TODO : remove the basic indentation of the element (to have a better display in the text tutorial ... return value diff --git a/codeBB/BB_IndentAndDot.py b/codeBB/BB_IndentAndDot.py index ab2e3c7..a4de40b 100644 --- a/codeBB/BB_IndentAndDot.py +++ b/codeBB/BB_IndentAndDot.py @@ -47,13 +47,15 @@ def transcode(value): value = re.sub(r'\n:', r'\n:INDENT:', value) - p = re.compile('((\:INDENT\:(.*?)\n)*)') + p = re.compile('((\:INDENT\:(.*?)\n)*)', + flags=re.DOTALL) value = p.sub(replace_wiki_identation, value) value = re.sub(r'\*\*(.*?)\n', r'
  • \1
  • ', - value) + value, + flags=re.DOTALL) return value @@ -61,7 +63,7 @@ def transcode(value): def replace_wiki_identation(match): if match.group() == "": return "" - debug.info("plop: " + str(match.group())) + #debug.verbose("plop: " + str(match.group())) value = "