linkifyjs icon indicating copy to clipboard operation
linkifyjs copied to clipboard

Linkify is not splitting out the link from the text correctly

Open DarynHolmes opened this issue 8 months ago • 1 comments

According to the docs when you have a string such as this:

Linkify creates a text node for .

This is not what is happening. It includes the "></script> as a part of the link. I have verified this by testing this locally and by using https://linkify.js.org/

Image

It works when there is just a quote after the url

Image

It does not work when any letter follows the last quote

Image

DarynHolmes avatar Apr 25 '25 12:04 DarynHolmes

Hi @DarynHolmes, thanks for reporting. This is an error in the documentation, but the behaviour is as expected. This is because real URLs can have quotes in them, like the one noted here: https://github.com/nfrasser/linkifyjs/issues/488#issuecomment-2847439471

nfrasser avatar May 07 '25 01:05 nfrasser