mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-7541 Fixed wiki html diff
This commit is contained in:
parent
44968276c1
commit
c2a95d4db6
1 changed files with 7 additions and 6 deletions
|
@ -46,15 +46,16 @@
|
||||||
$content0 = preg_replace('/(\S)\s+(\S)/', '$1 $2', $content0); // Remove multiple spaces.
|
$content0 = preg_replace('/(\S)\s+(\S)/', '$1 $2', $content0); // Remove multiple spaces.
|
||||||
$content = preg_replace('/\n|\r/i', ' ', $content);
|
$content = preg_replace('/\n|\r/i', ' ', $content);
|
||||||
$content = preg_replace('/(\S)\s+(\S)/', '$1 $2', $content);
|
$content = preg_replace('/(\S)\s+(\S)/', '$1 $2', $content);
|
||||||
|
|
||||||
/// Replace <p> </p>
|
/// Replace <p> </p>
|
||||||
$content0 = preg_replace('#(<p.*>( |\s+)</p>|<p.*></p>)#i', "\n", $content0);
|
$content0 = preg_replace('#(<p( [^>]*)?>( |\s+)</p>)|(<p( [^>]*)?></p>)#i', "\n", $content0);
|
||||||
$content = preg_replace('#(<p.*>( |\s+)</p>|<p.*></p>)#i', "\n", $content);
|
$content = preg_replace('#(<p( [^>]*)?>( |\s+)</p>)|(<p( [^>]*)?></p>)#i', "\n", $content);
|
||||||
|
|
||||||
|
|
||||||
/// Place new line characters at logical HTML positions.
|
/// Place new line characters at logical HTML positions.
|
||||||
$htmlendings = array('+(<br.*>)+iU', '+(<p.*>)+iU', '+(</p>)+i', '+(<hr.*>)+iU', '+(<ol.*>)+iU',
|
$htmlendings = array('+(<br.*?>)+iU', '+(<p( [^>]*)?>)+iU', '+(</p>)+i', '+(<hr.*?>)+iU', '+(<ol.*?>)+iU',
|
||||||
'+(</ol>)+i', '+(<ul.*>)+iU', '+(</ul>)+i', '+(<li.*>)+iU', '+(</li>)+i',
|
'+(</ol>)+i', '+(<ul.*?>)+iU', '+(</ul>)+i', '+(<li.*?>)+iU', '+(</li>)+i',
|
||||||
'+(</tr>)+i', '+(<div.*>)+iU', '+(</div>)+i');
|
'+(</tr>)+i', '+(<div.*?>)+iU', '+(</div>)+i');
|
||||||
$htmlrepl = array("\n\$1\n", "\n\$1\n", "\n\$1\n", "\n\$1\n", "\n\$1\n",
|
$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", "\n\$1\n", "\n\$1\n",
|
||||||
"\n\$1\n", "\n\$1\n", "\n\$1\n");
|
"\n\$1\n", "\n\$1\n", "\n\$1\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue