react-logviewer
react-logviewer copied to clipboard
enable links causes bugs
With body
aaa bbb ccc
wrap1 'http://bla.alb/add' wrap2 wrap3
[31m[1m>[22m[2m[39m[90m [36mthis[39m[33m.[39mextend([36mthis
Once enable links is on there are 3 problems:
- spaces are introduced and the third text line is seen as
this . extendrather than this.extend - content after the http link is gone (
wrap2 wrap3) - the http link itself lead to and address ending with a quote
Verified with the latest storybook as well as with the current code on main branch(150b55cff0b5ea4fffc5795f6b8103b1b0d39627)
Screenshot from storybook:
I believe the url issue is coming from the regex here: https://github.com/melloware/react-logviewer/blob/63c8418825a39581950e307a3a534994ef9c66b2/src/components/Utils/utils.ts#L291
The extra spaces comes from here: https://github.com/melloware/react-logviewer/blob/44cf21a56c6344bedeaf9cf6796f43df3abdf6be/src/components/LinePart/index.tsx#L129
uncertain what cuts off the rest of the line.