From 51e3a45835c2e74d2ceb8ed123385267d2de38d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 22 Sep 2011 16:55:28 +0200 Subject: [PATCH] Adds tables in MiniWiki (Closes #773). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- ChangeLog | 4 ++++ classes/miniwiki.php | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2c92e7c..c643246 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ ================================================================================ VERSION 1.1.6 XX XX XXXX +New: + + * #773: Adds tables in MiniWiki -JAC + ================================================================================ VERSION 1.1.5 28 06 2011 diff --git a/classes/miniwiki.php b/classes/miniwiki.php index ab547e0..d33fc05 100644 --- a/classes/miniwiki.php +++ b/classes/miniwiki.php @@ -32,6 +32,14 @@ class MiniWiki // retours à la ligne avec \\ MiniWiki::Markup("/\\\\(?".">(\\\\*))\n/e", "str_repeat('
\n',mb_strlen('$1'))", "str_repeat('\n',mb_strlen('$1'))", "ligne1\\\\\nligne2"); + // || Tables + MiniWiki::Markup("/((^|\n)\|\|(([^\n]*(\n|$))(\|\|[^\n]*(\n|$))*))/se", + "'

' + . str_replace(\"\n\", '', str_replace('||', '\n', preg_replace(\"/(^|\\n)\|\|/\", '\n
', preg_replace(\"/\|\|($|\\n)/\", '
', '$1')))) + . '

'", + "str_replace('||', '|', '$1')", + "||ligne1 colonne1||ligne1 colonne2||\n||ligne2 colonne1||ligne2 colonne2||"); + // * unordered list MiniWiki::Markup("/(^|\n)\*(([^\n]*(\n|$))(\*[^\n]*(\n|$))*)/se", "'

'", -- 2.1.4