react-logviewer icon indicating copy to clipboard operation
react-logviewer copied to clipboard

enable links causes bugs

Open roiros opened this issue 10 months ago • 3 comments

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:

  1. spaces are introduced and the third text line is seen as this . extend rather than this.extend
  2. content after the http link is gone (wrap2 wrap3)
  3. 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: Image

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.

roiros avatar Jan 23 '25 14:01 roiros