[ticket/13901] Add whitespace to short, multiline quotes for readability

PHPBB3-13901
This commit is contained in:
JoshyPHP 2015-05-30 22:20:52 +02:00
parent 2f0d11ba3c
commit b69e33c2b0
2 changed files with 6 additions and 1 deletions

View file

@ -69,7 +69,7 @@ class utils implements \phpbb\textformatter\utils_interface
$quote .= ' ' . $name . '=' . $this->enquote($value);
}
$quote .= ']';
$newline = (strlen($quote . $text . '[/quote]') > 80) ? "\n" : '';
$newline = (strlen($quote . $text . '[/quote]') > 80 || strpos($text, "\n") !== false) ? "\n" : '';
$quote .= $newline . $text . $newline . '[/quote]';
return $quote;

View file

@ -181,6 +181,11 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
array(),
'[quote]This is a short quote on its own line[/quote]',
),
array(
"This is a short quote\non two lines",
array(),
"[quote]\nThis is a short quote\non two lines\n[/quote]",
),
);
}