21 lines
637 B
JavaScript
21 lines
637 B
JavaScript
"use strict";
|
|
var HTMLEntitiesEncoder = (function () {
|
|
function HTMLEntitiesEncoder() {
|
|
}
|
|
HTMLEntitiesEncoder.prototype.getDisplayname = function () {
|
|
return "Encode HTML entities";
|
|
};
|
|
HTMLEntitiesEncoder.prototype.getId = function () {
|
|
return "encodehtmlentities";
|
|
};
|
|
HTMLEntitiesEncoder.prototype.convert = function (input) {
|
|
return input
|
|
.replace(/\&/g, "&")
|
|
.replace(/\</g, "<")
|
|
.replace(/\>/g, ">")
|
|
.replace(/\"/g, """);
|
|
};
|
|
return HTMLEntitiesEncoder;
|
|
}());
|
|
exports.HTMLEntitiesEncoder = HTMLEntitiesEncoder;
|