Static Methods
decodeHTMLEntity(htmlEntity)decodeHTMLEntity.jsline 23
Transform the given HTML Entity string into plain string.
PARAMETERS
Name Type Description htmlEntity
String
HTML Entity type string
RETURNS:
{String
} - Plain stringEXAMPLES
var decodeHTMLEntity = require('tui-code-snippet/string/decodeHTMLEntity'); // node, commonjs var htmlEntityString = "A 'quote' is <b>bold</b>" var result = decodeHTMLEntity(htmlEntityString); //"A 'quote' is <b>bold</b>"
encodeHTMLEntity(html)encodeHTMLEntity.jsline 19
Transform the given string into HTML Entity string.
PARAMETERS
Name Type Description html
String
String for encoding
RETURNS:
{String
} - HTML EntityEXAMPLES
var encodeHTMLEntity = require('tui-code-snippet/string/encodeHTMLEntity'); // node, commonjs var htmlEntityString = "<script> alert('test');</script><a href='test'>"; var result = encodeHTMLEntity(htmlEntityString);