Merge pull request #21770 from nextcloud/backport/21736/stable19

[stable19] Fix placeholder issues with multiplace spaces in the name
This commit is contained in:
Morris Jobke 2020-07-09 17:19:02 +02:00 committed by GitHub
commit 0fe7949f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -158,7 +158,7 @@ $.fn.imageplaceholder = function(seed, text, size) {
this.css('font-size', (height * 0.55) + 'px') this.css('font-size', (height * 0.55) + 'px')
if (seed !== null && seed.length) { if (seed !== null && seed.length) {
var placeholderText = text.split(' ', 2).map((word) => word[0].toUpperCase()).join('') var placeholderText = text.replace(/\s+/g, ' ').trim().split(' ', 2).map((word) => word[0].toUpperCase()).join('')
this.html(placeholderText); this.html(placeholderText);
} }
} }