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

"+" in links breaks the regex #57

Open
romannurik opened this issue Aug 12, 2024 · 1 comment
Open

"+" in links breaks the regex #57

romannurik opened this issue Aug 12, 2024 · 1 comment
Labels

Comments

@romannurik
Copy link

romannurik commented Aug 12, 2024

The library breaks for ANSI links that include + characters:

No + characters:

// you can generate this string via ansiEscapes.link(text, url) from the ansi-escapes npm lib
let str = "\u001b]8;;https://www.example.com/?q=hello\u0007hello\u001b]8;;\u0007";
console.log(str.replace(ansiRegex(), ''));
// expected: hello
// observed: hello

With + characters:

// you can generate this string via ansiEscapes.link(text, url) from the ansi-escapes npm lib
let str = "\u001b]8;;https://www.example.com/?q=hello+world\u0007hello\u001b]8;;\u0007";
console.log(str.replace(ansiRegex(), ''));
// expected: hello
// observed: ttps://www.example.com/?q=hello+worldhello
@romannurik romannurik changed the title "+" in links breaks the regex parser "+" in links breaks the regex Aug 12, 2024
@Fart10

This comment was marked as spam.

@Qix- Qix- added the bug label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants