Fix username regex
This commit is contained in:
parent
c71f37a8f8
commit
98355edf92
1 changed files with 4 additions and 2 deletions
|
|
@ -49,9 +49,11 @@ function shouldCollapse({ name, src, type, namespace }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserName(userId) {
|
function getUserName(userId) {
|
||||||
const match = userId.match("@(.+):");
|
const match = userId.match(/@([^\:]+):/);
|
||||||
|
|
||||||
return match && match.length > 0 ? match[1].replace("-", " ") : userId;
|
return match && match.length > 0
|
||||||
|
? match[1].replace("-", " ").replace("W", "")
|
||||||
|
: userId.replace("W", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatContent(type, content) {
|
function formatContent(type, content) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue