From: sam_marshall
Date: Fri, 8 Jun 2007 13:45:10 +0000 (+0000)
Subject: MDL-7541 Fixed wiki html diff
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c2a95d4db64d8749dc2b69c4d93b885d94613e58;p=moodle.git
MDL-7541 Fixed wiki html diff
---
diff --git a/mod/wiki/ewiki/plugins/moodle/diff.php b/mod/wiki/ewiki/plugins/moodle/diff.php
index 1f3388eda0..5a97691c77 100755
--- a/mod/wiki/ewiki/plugins/moodle/diff.php
+++ b/mod/wiki/ewiki/plugins/moodle/diff.php
@@ -46,15 +46,16 @@
$content0 = preg_replace('/(\S)\s+(\S)/', '$1 $2', $content0); // Remove multiple spaces.
$content = preg_replace('/\n|\r/i', ' ', $content);
$content = preg_replace('/(\S)\s+(\S)/', '$1 $2', $content);
-
+
/// Replace
- $content0 = preg_replace('#(( |\s+)
|)#i', "\n", $content0);
- $content = preg_replace('#(( |\s+)|)#i', "\n", $content);
+ $content0 = preg_replace('#(]*)?>( |\s+)
)|(]*)?>
)#i', "\n", $content0);
+ $content = preg_replace('#(]*)?>( |\s+)
)|(]*)?>
)#i', "\n", $content);
+
/// Place new line characters at logical HTML positions.
- $htmlendings = array('+()+iU', '+()+iU', '+()+i', '+()+iU', '+()+iU',
- '+()+i', '+()+iU', '+()+i', '+()+iU', '+()+i',
- '+()+i', '+()+iU', '+()+i');
+ $htmlendings = array('+()+iU', '+(]*)?>)+iU', '+(
)+i', '+()+iU', '+()+iU',
+ '+()+i', '+()+iU', '+()+i', '+()+iU', '+()+i',
+ '+()+i', '+()+iU', '+()+i');
$htmlrepl = array("\n\$1\n", "\n\$1\n", "\n\$1\n", "\n\$1\n", "\n\$1\n",
"\n\$1\n", "\n\$1\n", "\n\$1\n", "\n\$1\n", "\n\$1\n",
"\n\$1\n", "\n\$1\n", "\n\$1\n");