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:
Vasu Bhog
2021-10-08 15:24:00 -07:00
committed by GitHub
parent c35cd3e48f
commit faa29945a3
2 changed files with 12 additions and 7 deletions

View File

@@ -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;
}
});
}
/**