Update samy.ps1

This commit is contained in:
2025-12-20 20:20:41 -05:00
parent a5ece0f5c3
commit bf3779a104

View File

@@ -694,13 +694,6 @@ function Get-SamyTasks {
if ($t.PSObject.Properties.Name -contains 'Tooltip') { $tooltip = [string]$t.Tooltip }
if ([string]::IsNullOrWhiteSpace($tooltip)) { $tooltip = [string]$t.Label }
# Escape for HTML attribute
$tooltip = $tooltip -replace '&','&'
$tooltip = $tooltip -replace "'",'''
$tooltip = $tooltip -replace '"','"'
$tooltip = $tooltip -replace '<','&lt;'
$tooltip = $tooltip -replace '>','&gt;'
if ($t.PSObject.Properties.Name -contains 'Tooltip') {
$t.Tooltip = $tooltip
} else {
@@ -809,8 +802,9 @@ if (-not $Global:SamyTasks) {
$subHtml = (
$_.SubOptions |
ForEach-Object {
$subLabel = Escape-HtmlText ([string]$_.Label)
"<label style='margin-left:20px; display:block;'>
<input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $($_.Label)
<input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $subLabel
</label>"
}
) -join "`n"