mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +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);
|
||||
let curr = 0;
|
||||
for (let match of matches) {
|
||||
callback(match[0], true);
|
||||
callback(text.slice(curr, match.index), false);
|
||||
callback(match[0], true);
|
||||
const len = match[0].length;
|
||||
curr = match.index + len;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user