Skip to content

Commit fc0b418

Browse files
committed
fix: escape branch name in sidebar branch indicator
1 parent b6603dc commit fc0b418

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/extensions/default/Git/src/Branch.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,11 @@ define(function (require, exports) {
522522
const displayName = branchName.length > MAX_LEN
523523
? branchName.substring(0, MAX_LEN) + "\u2026"
524524
: branchName;
525-
const html = `<i class="fas fa-code-branch"></i> ${displayName}`;
525+
// branch names may contain characters like "<", so set them
526+
// as text and never as html
526527
$gitBranchName
527-
.html(html)
528+
.text(" " + displayName)
529+
.prepend('<i class="fas fa-code-branch"></i>')
528530
.attr("title", tooltip)
529531
.off("click")
530532
.on("click", toggleDropdown);

0 commit comments

Comments
 (0)