[#6982] disable separator escaping for the page title
This commit is contained in:
@@ -743,11 +743,12 @@ export default class CommonHelper {
|
||||
/**
|
||||
* Returns a concatenated `items` string.
|
||||
*
|
||||
* @param {String} items
|
||||
* @param {String} [separator]
|
||||
* @param {String} items
|
||||
* @param {String} [separator]
|
||||
* @param {Boolean} [escapeSeparator]
|
||||
* @return {Array}
|
||||
*/
|
||||
static joinNonEmpty(items, separator = ", ") {
|
||||
static joinNonEmpty(items, separator = ", ", escapeSeparator = true) {
|
||||
items = items || [];
|
||||
|
||||
const result = [];
|
||||
@@ -756,9 +757,11 @@ export default class CommonHelper {
|
||||
|
||||
for (let item of items) {
|
||||
item = typeof item === "string" ? item.trim() : "";
|
||||
if (!CommonHelper.isEmpty(item)) {
|
||||
result.push(item.replaceAll(trimmedSeparator, "\\" + trimmedSeparator));
|
||||
if (CommonHelper.isEmpty(item)) {
|
||||
continue;
|
||||
}
|
||||
item = escapeSeparator ? item.replaceAll(trimmedSeparator, "\\" + trimmedSeparator) : item;
|
||||
result.push(item);
|
||||
}
|
||||
|
||||
return result.join(separator);
|
||||
|
||||
Reference in New Issue
Block a user