Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable links causes bugs #81

Open
roiros opened this issue Jan 23, 2025 · 3 comments · Fixed by #82
Open

enable links causes bugs #81

roiros opened this issue Jan 23, 2025 · 3 comments · Fixed by #82
Assignees
Labels
bug Something isn't working
Milestone

Comments

@roiros
Copy link

roiros commented Jan 23, 2025

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(150b55c)

Screenshot from storybook:
Image

I believe the url issue is coming from the regex here:

const parts = token.split(new RegExp(/(\()*([^\)]+)(\))*/)).filter(Boolean);

The extra spaces comes from here:

{this.props.enableLinks ? " " : null}

uncertain what cuts off the rest of the line.

@melloware
Copy link
Owner

melloware commented Jan 23, 2025

PR is welcome.

cc @rapsealk

@melloware melloware added the bug Something isn't working label Jan 23, 2025
@rapsealk
Copy link
Contributor

Apologies for the inconvenience. I may have missed some cases. I will be able to start the investigation over the weekend.

@melloware
Copy link
Owner

Thanks @rapsealk i assigned it to you!

@melloware melloware added this to the 6.1.3 milestone Jan 24, 2025
@melloware melloware modified the milestones: 6.2.0, 6.2.1 Jan 31, 2025
@melloware melloware modified the milestones: 6.2.1, 6.2.0 Jan 31, 2025
@melloware melloware reopened this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants