(textToEncode: string)
| 29 | } |
| 30 | |
| 31 | function createHtml5EncodeMethods(textToEncode: string) { |
| 32 | const heOptions = {useNamedReferences: true}; |
| 33 | const nonAsciiPrintable: EncodeOptions = {level: 'html5', mode: 'nonAsciiPrintable'}; |
| 34 | const extensive: EncodeOptions = {level: 'html5', mode: 'extensive'}; |
| 35 | const nonAscii: EncodeOptions = {level: 'html5', mode: 'nonAscii'}; |
| 36 | return { |
| 37 | 'html-entities.encode - html5, nonAscii': () => encode(textToEncode, nonAscii), |
| 38 | 'html-entities.encode - html5, nonAsciiPrintable': () => encode(textToEncode, nonAsciiPrintable), |
| 39 | 'html-entities.encode - html5, extensive': () => encode(textToEncode, extensive), |
| 40 | '(old) Html5Entities.encodeNonASCII': () => html5Entities.encodeNonASCII(textToEncode), |
| 41 | 'entities.encodeHTML': () => entities.encodeHTML(textToEncode), |
| 42 | 'entities.encodeNonAsciiHTML': () => entities.encodeNonAsciiHTML(textToEncode), |
| 43 | 'he.encode': () => he.encode(textToEncode, heOptions) |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | function createHtml5DecodeMethods(textToDecode: string) { |
| 48 | const strict: DecodeOptions = {level: 'html5', scope: 'strict'}; |
no test coverage detected