Write tests and simplify logic

This commit is contained in:
Dolan Miu
2023-04-04 22:21:01 +01:00
parent 10c866bdea
commit 0386810714
3 changed files with 52 additions and 22 deletions

View File

@ -12,7 +12,7 @@ export const findRunElementIndexWithToken = (paragraphElement: Element, token: s
continue;
}
if ((text.elements?.[0].text as string)?.includes(token)) {
if ((text.elements[0].text as string)?.includes(token)) {
return i;
}
}