-
Notifications
You must be signed in to change notification settings - Fork 97
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
Support for ansi terminal links #51
Comments
Hi - I am not aware of this new tagging feature. Can you point me at where this is documented? If this is a new convention, that is great news. We could bring back the linkify code. |
The best documentation found so far is this. I'm using GNOME on Fedora, and I can confirm both of the above examples work. JS example to create terminal links: |
This is awesome! I'm happy to add support for this. In progress... 👍 |
Just an update. This is going to require a bit of work. However, that is ok. Now is a good time to clean up other parts as well. |
Great! This is my library of choice .) ... |
Hi - quick update. Made some good progress over the last few days. More soon. |
@LaKing - ok - code for testing is up on master. It required a lot of changes, but we were due for that anyways 👍 I will be cleaning it up and revising the Readme tomorrow. Lmk if you have any comments on the functionality. |
Works great! Updated my code, and found no issues so far. Thank you very much! The only thing left is an update on the readme, and publishing it to npm. .) |
Oopps, .. It works for the node way of creating links, but the bash way seems to left untouched as text. |
Okay, I found a bug I think. If the text part has a space, it breaks. Problematic code "link 12" with a space
Working code "link:12" with no spaces
Both of these work in the terminal, but the problematic html output is <span>]8;;http://example.com�link 12</span><span>]8;;�</span> By the way, the alternative bash code for writing links similar way as the node code does (with \a) ## standard
echo -e '\e]8;;http://example.com\aThis is a link\e]8;;\a'
## colored
echo -e '\e[34m\e]8;;http://example.com\aThis is a link\e]8;;\a\e[0m' |
One more thing. The URL part seems to rely on the protocol prefix, eg. http or https, thus relative links for example are not parsed, but left out empty. (no html at all) |
The current implementation is prone to a DOM-based XSS attack. Since the URL parameter allows \x21-\x7e characters and the URL gets inserted into PoC:
|
@alech - thx, will investigate |
@alech - ok, have time this week to work on all these issues. Updates soon. |
Plus other updates as we prepare for NPM release
I'm keeping this issue open for a few more days. Once I push the NPM, then I will close the issue. |
Ok - pushed out the npm release. Thanks to all for your help. |
I'm looking for a package that can convert ansi-tagged links to html.
This would produce a link from bash
or in a JS module:
Both test cases seem to be skipped by ansi_up. They are neither convertable to text, nor to html. Both seem to work in the terminal.
Could we get these supported?
Thank you very much.
The text was updated successfully, but these errors were encountered: