Fix bug in which links preceeded text
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
3beaf88a8b
commit
051771397c
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Reference in a new issue