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

OSC hyperlinks do not work with spaces #65

Closed
ehmicky opened this issue Apr 6, 2021 · 3 comments
Closed

OSC hyperlinks do not work with spaces #65

ehmicky opened this issue Apr 6, 2021 · 3 comments

Comments

@ehmicky
Copy link

ehmicky commented Apr 6, 2021

OSC hyperlinks do not work when the text includes spaces.

> const AnsiUp = require('ansi_up'); 

> const ansi = new AnsiUp.default;

> ansi.ansi_to_html('\x1B]8;;http://www.google.com\x07bb\x1B]8;;\x07')
'<a href="http://www.google.com">bb</a>'

> ansi.ansi_to_html('\x1B]8;;http://www.google.com\x07b b\x1B]8;;\x07')
']8;;http://www.google.com\x07b b'

ansi_up: 5.0.0
node: 15.13.0
Ubuntu 20.10

@drudru
Copy link
Owner

drudru commented Apr 6, 2021

I think I had a reason for this, but now I cannot remember. I will review this today.

@drudru
Copy link
Owner

drudru commented Apr 7, 2021

Ok - yeah, I will fix this. Thanks.
I think I half copy pasta'd the previous portion of the regex and half avoided the all whitespace anchor text problem. There was a little ambiguity In the spec by egmontkob, wrt handling incomplete OSC URL packets in the buffer. Regardless, having space there totally makes sense.

@drudru drudru closed this as completed in aaec94d Apr 7, 2021
@ehmicky
Copy link
Author

ehmicky commented Apr 7, 2021

Thanks @drudru!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants