(textToDecode: string)
| 45 | } |
| 46 | |
| 47 | function createHtml5DecodeMethods(textToDecode: string) { |
| 48 | const strict: DecodeOptions = {level: 'html5', scope: 'strict'}; |
| 49 | const body: DecodeOptions = {level: 'html5', scope: 'body'}; |
| 50 | const attribute: DecodeOptions = {level: 'html5', scope: 'attribute'}; |
| 51 | return { |
| 52 | 'html-entities.decode - html5, strict': () => decode(textToDecode, strict), |
| 53 | 'html-entities.decode - html5, body': () => decode(textToDecode, body), |
| 54 | 'html-entities.decode - html5, attribute': () => decode(textToDecode, attribute), |
| 55 | '(old) Html5Entities.decode': () => html5Entities.decode(textToDecode), |
| 56 | 'entities.decodeHTML': () => entities.decodeHTML(textToDecode), |
| 57 | 'entities.decodeHTMLStrict': () => entities.decodeHTMLStrict(textToDecode), |
| 58 | 'he.decode': () => he.decode(textToDecode) |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | function createHtml4EncodeMethods(textToEncode: string) { |
| 63 | const nonAsciiPrintable: EncodeOptions = {level: 'html4', mode: 'nonAsciiPrintable'}; |
no test coverage detected