mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-25 20:58:55 +00:00
[ticket/13901] Add whitespace to short, multiline quotes for readability
PHPBB3-13901
This commit is contained in:
parent
2f0d11ba3c
commit
b69e33c2b0
2 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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]",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue