Skip to content

enable links causes bugs #81

@roiros

Description

@roiros

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions