diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2015-06-24 22:41:58 +0200 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2015-06-25 22:51:43 +0200 |
commit | 5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5 (patch) | |
tree | 22efd3d60b4b70a3ce810ad5e57ae5dfa91dd80c | |
parent | 4c9507e20ad4e3de291143c8a40d5c977388f5a5 (diff) | |
download | forums-5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5.tar forums-5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5.tar.gz forums-5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5.tar.bz2 forums-5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5.tar.xz forums-5a55ce3f6832677e2c0a244d3a5c0b4c2587b8c5.zip |
[ticket/10620] Add more whitespace to long quotes in JS
PHPBB3-10620
-rw-r--r-- | phpBB/assets/javascript/editor.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js index f0fa064ec5..df353bc29d 100644 --- a/phpBB/assets/javascript/editor.js +++ b/phpBB/assets/javascript/editor.js @@ -241,6 +241,7 @@ function addquote(post_id, username, l_wrote, attributes) { * @return {!string} Quote block to be used in a new post/text */ function generateQuote(text, attributes) { + text = text.replace(/^\s+/, '').replace(/\s+$/, ''); var quote = '[quote'; if (attributes.author) { // Add the author as the BBCode's default attribute @@ -253,7 +254,9 @@ function generateQuote(text, attributes) { quote += ' ' + name + '=' + formatAttributeValue(value.toString()); } } - quote += ']' + text + '[/quote]'; + quote += ']'; + var newline = ((quote + text + '[/quote]').length > 80 || text.indexOf('\n') > -1) ? '\n' : ''; + quote += newline + text + newline + '[/quote]'; return quote; } |