mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-23 11:55:12 +00:00
Improve comment clarity for string escaping fix
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
@@ -298,7 +298,7 @@ export function setupDropdownCloseHandlers(): void {
|
|||||||
export function getActionButtonsHtml(filePath: string, small = false): string {
|
export function getActionButtonsHtml(filePath: string, small = false): string {
|
||||||
const btnClass = small ? 'btn-small' : '';
|
const btnClass = small ? 'btn-small' : '';
|
||||||
const iconSize = small ? 14 : 16;
|
const iconSize = small ? 14 : 16;
|
||||||
// Escape backslashes first, then single quotes to prevent breaking out of string context
|
// Escape backslashes first, then single quotes to prevent breaking out of the JavaScript string literal in the onclick attribute
|
||||||
const escapedPath = filePath.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
const escapedPath = filePath.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
Reference in New Issue
Block a user