src code

instance method String#escapeHTML

String#escapeHTML() → String

Converts HTML special characters to their entity equivalents.

Example
'<div class="article">This is an article</div>'.escapeHTML();
// -> "&lt;div class="article"&gt;This is an article&lt;/div&gt;"