Skip to content

Commit de34f66

Browse files
Resolve Copilot comment
1 parent 719b334 commit de34f66

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

infra/scripts/validate_bicep_params.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from __future__ import annotations
3030

3131
import argparse
32+
import html
3233
import json
3334
import re
3435
import sys
@@ -347,12 +348,7 @@ def print_report(results: list[ValidationResult], *, use_color: bool = True) ->
347348

348349
def _html_escape(text: str) -> str:
349350
"""Escape HTML special characters."""
350-
return (
351-
text.replace("&", "&")
352-
.replace("<", "&lt;")
353-
.replace(">", "&gt;")
354-
.replace('"', "&quot;")
355-
)
351+
return html.escape(text, quote=True)
356352

357353

358354
def generate_html_report(

0 commit comments

Comments
 (0)