Fix: Resolve parsing error and svelte/no-at-html-tags linting issues

Resolved a critical parsing error in leads_view_lead.svelte due to incorrect Svelte class directive syntax.

Addressed multiple svelte/no-at-html-tags linting errors across the following files to mitigate potential XSS vulnerabilities and improve code safety:
- src/routes/events_leads/exhibit/[slug]/leads_add_scan.svelte
- src/routes/events_leads/exhibit/[slug]/leads_manage.svelte
- src/routes/events_leads/exhibit/[slug]/leads_view_lead.svelte

Replaced {@html} blocks with safer Svelte conditional rendering ({#if}) and direct interpolation ({value}) for static and dynamic content where appropriate. Removed commented-out {@html} tags that were still triggering linting errors.
This commit is contained in:
Scott Idem
2025-11-17 19:11:01 -05:00
parent 7e1eaba3bc
commit 3a0d901a05
7 changed files with 198 additions and 297 deletions

View File

@@ -293,9 +293,11 @@
$events_loc.leads.default_to_scan = !$events_loc.leads.default_to_scan;
}}
>
{@html $events_loc.leads.default_to_scan
? '<span class="fas fa-toggle-on m-1"></span> Disable Default Scan?'
: '<span class="fas fa-toggle-off m-1"></span> Enable Default Scan?'}
{#if $events_loc.leads.default_to_scan}
<span class="fas fa-toggle-on m-1"></span> Disable Default Scan?
{:else}
<span class="fas fa-toggle-off m-1"></span> Enable Default Scan?
{/if}
</button>
<button
@@ -309,9 +311,11 @@
$events_loc.leads.auto_view = !$events_loc.leads.auto_view;
}}
>
{@html $events_loc.leads.auto_view
? '<span class="fas fa-toggle-on m-1"></span> Disable Auto View?'
: '<span class="fas fa-toggle-off m-1"></span> Enable Auto View?'}
{#if $events_loc.leads.auto_view}
<span class="fas fa-toggle-on m-1"></span> Disable Auto View?
{:else}
<span class="fas fa-toggle-off m-1"></span> Enable Auto View?
{/if}
</button>
{#if $events_loc.leads.show_content__scan_requirements}
@@ -827,7 +831,7 @@
{/if}
<div class="qr_quick_results preset-tonal-secondary font-bold p-4">
{@html $events_sess.leads.qr_scan_result ?? 'No results yet'}
{$events_sess.leads.qr_scan_result ?? 'No results yet'}
</div>
<!-- This block needs to be moved or something. It takes up too much space! -->