mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-09 16:44:26 +02:00
New bbcode element: "spoiler". Mail: Top post quotes are now embraced in "spoiler" elements
This commit is contained in:
parent
b5120888cf
commit
8a1f175df0
6 changed files with 39 additions and 5 deletions
|
@ -189,8 +189,18 @@ function bbcode($Text,$preserve_nl = false) {
|
|||
// Check for [code] text
|
||||
$Text = preg_replace("/\[code\](.*?)\[\/code\]/ism","$CodeLayout", $Text);
|
||||
|
||||
// Declare the format for [spoiler] layout
|
||||
$SpoilerLayout = '<blockquote class="spoiler">$1</blockquote>';
|
||||
|
||||
// Check for [spoiler] text
|
||||
// handle nested quotes
|
||||
$endlessloop = 0;
|
||||
while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20))
|
||||
$Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism","$SpoilerLayout", $Text);
|
||||
|
||||
// Declare the format for [quote] layout
|
||||
$QuoteLayout = '<blockquote>$1</blockquote>';
|
||||
|
||||
// Check for [quote] text
|
||||
// handle nested quotes
|
||||
$endlessloop = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue