]*)?>((?:(?R)|.)*?)\n
(\s|$);msi', $html, $code_match);
+ $i = 0;
+ foreach ( $code_match[0] as $code )
+ {
+ $html = str_replace_once($code, "{TW_CODE:$i:$rand_seed}", $html);
+ $i++;
+ }
$html = preg_replace('#<([a-z]+)([\s]+)([^>]+?)'.htmlalternatives('javascript:').'(.+?)>(.*?)\\1>#is', '<\\1\\2\\3javascript:\\59>\\60</\\1>', $html);
$html = preg_replace('#<([a-z]+)([\s]+)([^>]+?)'.htmlalternatives('javascript:').'(.+?)>#is', '<\\1\\2\\3javascript:\\59>', $html);
@@ -1900,6 +1920,22 @@
// Unstrip comments
$html = preg_replace('/<!--([^>]*?)-->/i', '', $html);
+
+ // Restore stripped comments
+ $i = 0;
+ foreach ( $comment_match[0] as $comment )
+ {
+ $html = str_replace_once("{HTMLCOMMENT:$i:$rand_seed}", $comment, $html);
+ $i++;
+ }
+
+ // Restore stripped code
+ $i = 0;
+ foreach ( $code_match[0] as $code )
+ {
+ $html = str_replace_once("{TW_CODE:$i:$rand_seed}", $code, $html);
+ $i++;
+ }
return $html;
diff -r e1a22031b5bd -r ad00dc1f8706 includes/render.php
--- a/includes/render.php Fri Oct 05 01:57:00 2007 -0400
+++ b/includes/render.php Sat Oct 06 13:01:46 2007 -0400
@@ -248,6 +248,12 @@
$text = preg_replace('/([\s]*?)<\/p>#is', '', $result);
+ $result = preg_replace('#
([\s]*?)