spoiler-auto-cw #1

Closed
keith wants to merge 5 commits from spoiler-auto-cw into megamerge
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 1e7471b71e - Show all commits

View File

@ -2184,9 +2184,9 @@ class BBCode
* Returns a list of the headings of "spoiler" elements
*
* @param string $text The text containing spoiler elements
* @return array The list of spoiler headings
* @return string The list of spoiler headings
*/
public static function getSpoilerHeadings(string $text): array
public static function getSpoilerHeadings(string $text): string
{
DI::profiler()->startRecording('rendering');
@ -2197,7 +2197,7 @@ class BBCode
$headings[] = BBCode::toPlaintext($item);
}
}
return $headings;
return implode(', ', $headings);
});
DI::profiler()->stopRecording();

View File

@ -1605,7 +1605,7 @@ class Transmitter
} else {
$warnings = BBCode::getSpoilerHeadings($item['body']);
if ($warnings) {
$data['summary'] = implode(', ', $warnings);
$data['summary'] = $warnings;
$data['keithext:summaryFromSpoilers'] = true;
}
}