20 lines
410 B
TypeScript
20 lines
410 B
TypeScript
import {Converter} from "./converter";
|
|
|
|
export class HTMLEntitiesDecoder implements Converter {
|
|
getDisplayname(): string {
|
|
return "Decode HTML entities";
|
|
}
|
|
|
|
getId(): string {
|
|
return "decodehtmlentities";
|
|
}
|
|
|
|
convert(input: string): string {
|
|
return input
|
|
.replace(/\"\;/g, "\"")
|
|
.replace(/\>\;/g, ">")
|
|
.replace(/\<\;/g, "<")
|
|
.replace(/\&\;/g, "&");
|
|
}
|
|
}
|