linkifyjs icon indicating copy to clipboard operation
linkifyjs copied to clipboard

Only one trailing parenthesis linkified

Open filippog opened this issue 8 years ago • 1 comments

Hi! I tried linkifying an url like this at the demo page: https://foo.bar/?a=b((((aaaa)))) and the resulting link included only the first ) but not the remaining ones.

filippog avatar Aug 07 '17 20:08 filippog

This is an unfortunate limitation of Linkify's parser. It must account for links wrapped in parens (e.g., Visit GitHub (https://github.com) as well as those with parens in the query like the one you provided.

It's difficult (though not impossible) to fix. It would require totally rewriting the parser code. So I wouldn't expect a fix out any time soon

The parser code is here, for anyone that wants to take a stab at this: https://github.com/SoapBox/linkifyjs/blob/master/src/linkify/core/parser.js

It's a very basic, memory-less state machine. Giving it some memory should do the trick.

nfrasser avatar Mar 03 '18 20:03 nfrasser