parse mutiple lines and whitespace?
| Project: | Collapsible Text |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
What reg pattern should I use make it parse all whitespace and multiple lines?
Right now only the first paragraph of my text is included in the collapsible field. I would like it to include everything.
I'm thinking changes should be done to the following... but not sure how...
/**
* Provides a layer of encapsulation for the regex call.
*/
function collapse_text_process($text) {
// Per #259535 and #233877, add ability to specify title
// in collapse text. Thanks rivena, Justyn
$text = preg_replace_callback('/
\[ # 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
(.+?) # then capture as few characters as possible until
\[\/collapse\] # a closing "tag", which is a slash followed by `collapse` in brackets
/smx',
"_collapse_text_replace_callback", $text);
return $text;
}
