Skip to content

Commit 632e135

Browse files
Copilotalexr00
andcommitted
Add escaping for special characters in issue titles
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 3bc6b82 commit 632e135

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/issues/issuesView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ export class IssuesTreeData
117117
};
118118

119119
if (this.stateManager.currentIssue(element.uri)?.issue.number === element.number) {
120+
// Escape any $(...) syntax to avoid rendering issue titles as icons.
121+
const escapedTitle = element.title.replace(/\$\([a-zA-Z0-9~-]+\)/g, '\\$&');
120122
const label: vscode.TreeItemLabel2 = {
121-
label: new vscode.MarkdownString(`$(check) ${element.title}`, true)
123+
label: new vscode.MarkdownString(`$(check) ${escapedTitle}`, true)
122124
};
123125
treeItem.label = label as vscode.TreeItemLabel;
124126
treeItem.contextValue = 'currentissue';

0 commit comments

Comments
 (0)