mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Fix Link Callout Dialog consistency in split/md (#17313)
* fix consistency with space and %20 files in split/md * add a test
This commit is contained in:
@@ -26,13 +26,15 @@ export function escapeLabel(unescapedLabel: string): string {
|
||||
*/
|
||||
export function escapeUrl(unescapedUrl: string): string {
|
||||
let firstEscape = strings.escape(unescapedUrl);
|
||||
return firstEscape.replace(/[()]/g, function (match) {
|
||||
switch (match) {
|
||||
case '(': return '%28';
|
||||
case ')': return '%29';
|
||||
default: return match;
|
||||
}
|
||||
});
|
||||
return firstEscape.replace(/%20/g, '%2520')
|
||||
.replace(/\s/g, '%20')
|
||||
.replace(/[()]/g, function (match) {
|
||||
switch (match) {
|
||||
case '(': return '%28';
|
||||
case ')': return '%29';
|
||||
default: return match;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user