mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-26 20:21:40 +01:00
Fix bug in which links preceeded text
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
3beaf88a8b
commit
051771397c
@ -3,8 +3,8 @@ export function linkify(text, callback) {
|
|||||||
const matches = text.matchAll(regex);
|
const matches = text.matchAll(regex);
|
||||||
let curr = 0;
|
let curr = 0;
|
||||||
for (let match of matches) {
|
for (let match of matches) {
|
||||||
callback(match[0], true);
|
|
||||||
callback(text.slice(curr, match.index), false);
|
callback(text.slice(curr, match.index), false);
|
||||||
|
callback(match[0], true);
|
||||||
const len = match[0].length;
|
const len = match[0].length;
|
||||||
curr = match.index + len;
|
curr = match.index + len;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user