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
fix parenthesis encoding in unicode highlighting #146248
Conversation
@@ -510,6 +510,10 @@ export class UnicodeHighlighterHoverParticipant implements IEditorHoverParticipa | |||
} | |||
} | |||
|
|||
function fixedEncodeURIComponent(str: string): string { | |||
return encodeURIComponent(str.replace(/[()]/g, escape)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@@ -496,7 +496,7 @@ export class UnicodeHighlighterHoverParticipant implements IEditorHoverParticipa | |||
|
|||
const adjustSettings = nls.localize('unicodeHighlight.adjustSettings', 'Adjust settings'); | |||
const contents: Array<IMarkdownString> = [{ | |||
value: `${reason} [${adjustSettings}](command:${ShowExcludeOptions.ID}?${encodeURIComponent(JSON.stringify(adjustSettingsArgs))})`, | |||
value: `${reason} [${adjustSettings}](command:${ShowExcludeOptions.ID}?${fixedEncodeURIComponent(JSON.stringify(adjustSettingsArgs))})`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the issue actually is that the escaping conflicts with markdown.
I think the correct fix would be to use this helper:
vscode/src/vs/base/common/htmlContent.ts
Line 78 in 30e1c0c
appendLink(target: URI | string, label: string, title?: string): MarkdownString { |
Sorry for only noticing now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with MarkdownString
Thanks a lot! |
This PR fixes #146225