26 lines
524 B
Plaintext
26 lines
524 B
Plaintext
:sig
|
|
String html_escape(String s)
|
|
|
|
:params
|
|
s : string to be escaped
|
|
return value : an HTML-safe escaped version of 's'
|
|
|
|
:see
|
|
>string
|
|
json_encode
|
|
print
|
|
component
|
|
|
|
:content
|
|
Returns a version of the input string where special HTML characters are replaced by entities:
|
|
|
|
- `&` becomes `&`
|
|
- `<` becomes `<`
|
|
- `>` becomes `>`
|
|
- `"` becomes `"`
|
|
|
|
## Related Concepts
|
|
|
|
- PHP: `htmlspecialchars()` or `htmlentities()`
|
|
- JavaScript / Node.js: safe text insertion via `textContent` or server-side HTML escaping libraries
|