Skip to content

Commit 71a6267

Browse files
Merge pull request #21736 from nextcloud/bugfix/21433
Fix placeholder issues with multiplace spaces in the name
2 parents 8f4d533 + 00d545f commit 71a6267

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

core/js/dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/js/dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/jquery/placeholder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ $.fn.imageplaceholder = function(seed, text, size) {
164164
this.css('font-size', (height * 0.55) + 'px')
165165

166166
if (seed !== null && seed.length) {
167-
var placeholderText = text.split(' ', 2).map((word) => word[0].toUpperCase()).join('')
167+
var placeholderText = text.replace(/\s+/g, ' ').trim().split(' ', 2).map((word) => word[0].toUpperCase()).join('')
168168
this.html(placeholderText);
169169
}
170170
}

0 commit comments

Comments
 (0)