htmlchars2sql
v1.0.3
Published
Conversion of html special characters for sql
Downloads
2
Maintainers
Readme
htmlChars2Sql
Conversion of html special characters for sql
Usage
import htmlChars2Sql from 'htmlChars2Sql'
htmlChars2Sql(`<div>"Hello world"</div>`)
Example
import htmlChars2Sql from 'htmlChars2Sql'
var singleQuotes = `<div>'Single quotes'</div>`
var doubleQuotation = `<div>"Double quotation"</div>`
var ampersand = `<div>& ampersand</div>`
var lineBreak = `<div>\n lineBreak</div>`
var mix = `<div>Single quotes:' Double quotation:" ampersand:& lineBreak:\n</div>`
htmlChars2Sql(singleQuotes) //<div>'Single quotes'</div>
htmlChars2Sql(doubleQuotation) //<div>"Double quotation"</div>
htmlChars2Sql(ampersand) //<div>& ampersand</div>
htmlChars2Sql(lineBreak) //<div><br> lineBreak</div>
htmlChars2Sql(mix) //<div>Single quotes:' Double quotation:" ampersand:& backslash:<br></div>