diff --git a/src/Module/Item.php b/src/Module/Item.php index 86b33a49c..8dcd089fb 100644 --- a/src/Module/Item.php +++ b/src/Module/Item.php @@ -1026,14 +1026,21 @@ class Item extends Controller // and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.) // we may need virtual or template classes to implement the possible alternatives - if (str_contains($body, '[/summary]')) { + if (str_contains($body, '[/summary]') || str_contains($body, '')) { + $body = wrap_code($body); $match = ''; $cnt = preg_match("/\[summary](.*?)\[\/summary]/ism", $body, $match); if ($cnt) { $summary .= $match[1]; } - $body_content = preg_replace("/^(.*?)\[summary](.*?)\[\/summary]/ism", '', $body); - $body = trim($body_content); + $cnt = preg_match("/\(.*?)\<\/summary>/ism", $body, $match); + if ($cnt) { + $summary .= $match[1]; + } + $body = preg_replace("/^(.*?)\[summary](.*?)\[\/summary]/ism", '', $body); + $body = preg_replace("/^(.*?)\(.*?)\<\/summary>/ism", '', $body); + $body = trim($body); + $body = unwrap_code($body); } $summary = wrap_code($summary);