You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Add space after if
This commit is contained in:
@ -102,13 +102,13 @@ export function _t(text, variables, tags) {
|
|||||||
export function substitute(text, variables, tags) {
|
export function substitute(text, variables, tags) {
|
||||||
const regexpMapping = {};
|
const regexpMapping = {};
|
||||||
|
|
||||||
if(variables !== undefined) {
|
if (variables !== undefined) {
|
||||||
for (const variable in variables) {
|
for (const variable in variables) {
|
||||||
regexpMapping[`%\\(${variable}\\)s`] = variables[variable];
|
regexpMapping[`%\\(${variable}\\)s`] = variables[variable];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tags !== undefined) {
|
if (tags !== undefined) {
|
||||||
for (const tag in tags) {
|
for (const tag in tags) {
|
||||||
regexpMapping[`(<${tag}>(.*?)<\\/${tag}>|<${tag}>|<${tag}\\s*\\/>)`] = tags[tag];
|
regexpMapping[`(<${tag}>(.*?)<\\/${tag}>|<${tag}>|<${tag}\\s*\\/>)`] = tags[tag];
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ export function replaceByRegexes(text, mapping) {
|
|||||||
|
|
||||||
let replaced;
|
let replaced;
|
||||||
// If substitution is a function, call it
|
// If substitution is a function, call it
|
||||||
if(mapping[regexpString] instanceof Function) {
|
if (mapping[regexpString] instanceof Function) {
|
||||||
replaced = mapping[regexpString].apply(null, capturedGroups);
|
replaced = mapping[regexpString].apply(null, capturedGroups);
|
||||||
} else {
|
} else {
|
||||||
replaced = mapping[regexpString];
|
replaced = mapping[regexpString];
|
||||||
@ -175,7 +175,7 @@ export function replaceByRegexes(text, mapping) {
|
|||||||
output.push(replaced);
|
output.push(replaced);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof replaced === 'object') {
|
if (typeof replaced === 'object') {
|
||||||
shouldWrapInSpan = true;
|
shouldWrapInSpan = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ export function replaceByRegexes(text, mapping) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldWrapInSpan) {
|
if (shouldWrapInSpan) {
|
||||||
return React.createElement('span', null, ...output);
|
return React.createElement('span', null, ...output);
|
||||||
} else {
|
} else {
|
||||||
return output.join('');
|
return output.join('');
|
||||||
|
Reference in New Issue
Block a user