unescapeHtml
Unescapes the HTML entities &, <, >, ", and '
back to &, <, >, ", and '.
This is the exact inverse of escapeHtml — it only recognizes the
five entities that function produces, not the full HTML entity set (no
, no numeric code points beyond ', etc.).
Available since v3.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
str | string | The string to unescape |
Returns
Section titled “Returns”string — The unescaped string
Examples
Section titled “Examples”Unescape HTML entities back to their original characters
Section titled “Unescape HTML entities back to their original characters”Inverse of escapeHtml — turns <, >, &, ”, ’ back into < > & ” ’.
Unrecognized entities are left untouched
Section titled “Unrecognized entities are left untouched”Only the five entities escapeHtml produces are unescaped — not the full HTML entity set.
