converter/src/app/converter/htmlentitiesdecoder.js

21 lines
642 B
JavaScript

"use strict";
var HTMLEntitiesDecoder = (function () {
function HTMLEntitiesDecoder() {
}
HTMLEntitiesDecoder.prototype.getDisplayname = function () {
return "Decode HTML entities";
};
HTMLEntitiesDecoder.prototype.getId = function () {
return "decodehtmlentities";
};
HTMLEntitiesDecoder.prototype.convert = function (input) {
return input
.replace(/\&quot\;/g, "\"")
.replace(/\&gt\;/g, ">")
.replace(/\&lt\;/g, "<")
.replace(/\&amp\;/g, "&");
};
return HTMLEntitiesDecoder;
}());
exports.HTMLEntitiesDecoder = HTMLEntitiesDecoder;