encode-html
Version:
encode html entities
18 lines (14 loc) • 458 B
JavaScript
var encode = require('./index');
var test = require('tape');
test('should have no apostrophe', function(t){
var text = "SENSE ' s";
var encoded = encode(text);
t.equal(encoded, 'SENSE ' s');
t.end();
});
test('should have no "< > \' &(single)" ', function(t){
var text = '<div class="hidden">NON&SENSE\'s</div>';
var encoded = encode(text);
t.equal(encoded, '<div class="hidden">NON&SENSE's</div>');
t.end();
});