From 1f6bb9c84d9382708181f8623257e48be1f32f0e Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Sat, 29 Jan 2022 21:41:55 -0800 Subject: [PATCH] Trim characters off match instead to get key, fixes #141614 --- src/vs/workbench/contrib/preferences/browser/settingsTree.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 6a132a713fae3..464d79af8b839 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -2130,7 +2130,8 @@ function cleanRenderedMarkdown(element: Node): void { } function fixSettingLinks(text: string, linkify = true): string { - return text.replace(/`#([^#]*)#`|'#([^#]*)#'/g, (match, settingKey) => { + return text.replace(/`#([^#]*)#`|'#([^#]*)#'/g, (match) => { + const settingKey = match.substring(2, match.length - 2); const targetDisplayFormat = settingKeyToDisplayFormat(settingKey); const targetName = `${targetDisplayFormat.category}: ${targetDisplayFormat.label}`; return linkify ?