Skip to content

Commit a4c9a9c

Browse files
Resolve Copilot Comment
1 parent 5d4e538 commit a4c9a9c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

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
@@ -349,12 +350,7 @@ def print_report(results: list[ValidationResult], *, use_color: bool = True) ->
349350

350351
def _html_escape(text: str) -> str:
351352
"""Escape HTML special characters."""
352-
return (
353-
text.replace("&", "&")
354-
.replace("<", "&lt;")
355-
.replace(">", "&gt;")
356-
.replace('"', "&quot;")
357-
)
353+
return html.escape(text, quote=True)
358354

359355

360356
def generate_html_report(

0 commit comments

Comments
 (0)