Support semi-colons in OSC 8 hyperlink URIs#5003
Merged
Tyriar merged 4 commits intoxtermjs:masterfrom Apr 22, 2024
Merged
Conversation
…etHyperlink().
jerch
previously requested changes
Mar 15, 2024
Member
jerch
left a comment
There was a problem hiding this comment.
@josiahhudson Thx for looking into this. I have a few remarks:
- Plz see my comment below, imho doing it with a regexp is a bit over-engineered.
- Would also be nice to have this covered by a test case.
- I just saw, that the
setHyperlinkhandler returnsfalsein some cases, which is suboptimal, as the parser has an optimization for the thetruecase (since it is a default handler in xterm.js it can always returntrue). Could you also change that?
Contributor
Author
|
lol, feedback makes sense. Happy to make the changes. I struggled to find a good place to put a test when I was looking at this, but I was short on time so I'll give it another go. I'll do it earlier if I can, but I may not have time to look at this again till Friday. |
Tyriar
approved these changes
Apr 21, 2024
Member
Tyriar
left a comment
There was a problem hiding this comment.
Thanks @josiahhudson, I tweaked it to use @jerch's suggestion and added a couple of tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original code performed a simple
data.split(';')which split on every ";" in the string. This new version treats the first ";" as the only split character, ensuring that params are properly separated from the URI.