--- collapse_text/collapse_text.module.orig 2009-07-05 18:12:11.000000000 -0700
+++ collapse_text/collapse_text.module 2009-07-05 18:11:23.000000000 -0700
@@ -63,14 +63,18 @@
// Per #259535 and #233877, add ability to specify title
// in collapse text. Thanks rivena, Justyn
$text = preg_replace_callback('/
+ (?:
)? # remove paragraph is right before and after
\[ # look for an opening bracket
collapse # followed by the word `collapse`
(\ collapsed)? # followed by (optionally) a space and the word `collapsed` (captured)
(?:\ title=([^\]]*))? # followed by (optionally) a space and a title, consisting of any
# characters except a close bracket (captured)
\] # followed by a closing bracket
+ (?:<\/p\s*>)? # remove paragraph is right before and after
(.+?) # then capture as few characters as possible until
+ (?:)? # remove paragraph is right before and after
\[\/collapse\] # a closing "tag", which is a slash followed by `collapse` in brackets
+ (?:<\/p\s*>)? # remove paragraph is right before and after
/smx',
"_collapse_text_replace_callback", $text);
return $text;