1.1.3 • Published 4 years ago

escape-html-tags v1.1.3

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Escape Html Tags

Escape html tags to insert html into html code

escapeHtmlTags(input) ⇒ string

Escape special characters in the given string of text. This function will escape the following characters: ", ', &, <, and >.

Kind: global function

ParamTypeDescription
inputstringThe string to escape for inserting into HTML

The escapeHtml function is designed to accept a string input of text and return an escaped value.

const escapeHtml = require('escape-html')

// example values
const str = 'Escaping <i>html</i> works fine.'
// example passing text in span element
console.log('<span name="desc">' + escapeHtml(str) + '</span>')
// -> '<span name="desc">Escaping &lt;i&gt;html&lt;/i&gt; works fine.</span>'
1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago