19 lines
449 B
TypeScript
19 lines
449 B
TypeScript
import {Converter} from "./converter";
|
|
|
|
export class HTMLEntitiesEncoder implements Converter {
|
|
getDisplayname():string {
|
|
return "Encode HTML entities";
|
|
}
|
|
|
|
getId():string {
|
|
return "encodehtmlentities";
|
|
}
|
|
|
|
convert(input:string):string {
|
|
return input
|
|
.replace(/\&/g, "&")
|
|
.replace(/\</g, "<")
|
|
.replace(/\>/g, ">")
|
|
.replace(/\"/g, """);
|
|
}
|
|
}
|