pipr.tools

html-encode

Escape HTML entities

{ } Encode

Try it

stdin0 chars
stdout0 chars

Example

Escape HTML for safe display

Usage
$ echo "<div class="alert">5 > 3 & 2 < 4</div>" | html-encode
View source
(input) =>
      input
        .replace(/&/g, "&amp;")
        .replace(/</g, "&lt;")
        .replace(/>/g, "&gt;")
        .replace(/"/g, "&quot;")
        .replace(/'/g, "&#039;")

Suggested Pipelines

Related Tools