Skip to content

Commit f55bf33

Browse files
authored
fix: include non-link results in parseLinks result (#64)
1 parent 36c80f3 commit f55bf33

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/Utils/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,12 @@ export const parseLinks = (lines: any[]): LinePartCss[] => {
259259
const arr = line.text.split(" ");
260260

261261
let found = false;
262+
let partial = '';
262263

263264
arr.forEach((text: string) => {
264265
if (text.search(strictUrlRegex) > -1) {
266+
result.push({ text: partial.trimEnd() });
267+
partial = '';
265268
found = true;
266269
const email = true;
267270
const link = true;
@@ -285,6 +288,8 @@ export const parseLinks = (lines: any[]): LinePartCss[] => {
285288

286289
return;
287290
}
291+
292+
partial += text + ' ';
288293
});
289294

290295
if (!found) {

0 commit comments

Comments
 (0)