aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-06-24 16:34:53 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-06-24 16:34:53 +0200
commitd430acb5680ddfd249daf1bd41a268ed47a6823e (patch)
treefa9d056d31b7237843842f982a2aaf300f4d1cd7 /phpBB/phpbb/textformatter
parentc1b16930989774051fbc84c8e5634dd83aae7835 (diff)
parent433021f429f22dfd6d5dfc16c11195b19a488161 (diff)
downloadforums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar
forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar.gz
forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar.bz2
forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.tar.xz
forums-d430acb5680ddfd249daf1bd41a268ed47a6823e.zip
Merge pull request #3669 from s9e/ticket/13901
[ticket/13901] Add more whitespace to long quotes for readability
Diffstat (limited to 'phpBB/phpbb/textformatter')
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php
index 04df589930..803c71a5a2 100644
--- a/phpBB/phpbb/textformatter/s9e/utils.php
+++ b/phpBB/phpbb/textformatter/s9e/utils.php
@@ -56,6 +56,7 @@ class utils implements \phpbb\textformatter\utils_interface
*/
public function generate_quote($text, array $attributes = array())
{
+ $text = trim($text);
$quote = '[quote';
if (isset($attributes['author']))
{
@@ -67,7 +68,9 @@ class utils implements \phpbb\textformatter\utils_interface
{
$quote .= ' ' . $name . '=' . $this->enquote($value);
}
- $quote .= ']' . $text . '[/quote]';
+ $quote .= ']';
+ $newline = (strlen($quote . $text . '[/quote]') > 80 || strpos($text, "\n") !== false) ? "\n" : '';
+ $quote .= $newline . $text . $newline . '[/quote]';
return $quote;
}