18 lines
447 B
Plaintext
18 lines
447 B
Plaintext
:sig
|
|
String html_escape(String s)
|
|
|
|
:params
|
|
s : string to be escaped
|
|
return value : an HTML-safe escaped version of 's'
|
|
|
|
:desc
|
|
Returns a version of the input string where the following characters have been replace by HTML entities:
|
|
- & → &
|
|
- < → lt;
|
|
- > → >
|
|
- " → "
|
|
|
|
:related
|
|
**PHP:** `htmlspecialchars()` or `htmlentities()`
|
|
**JavaScript / Node.js:** Safe text insertion via `textContent` or server-side HTML escaping libraries
|