(
html: string,
implicitTags: string[] = [],
implicitAttrs: {[k: string]: string[]} = {},
preserveSignificantWhitespace = true,
)
| 412 | } |
| 413 | |
| 414 | export function _extractMessages( |
| 415 | html: string, |
| 416 | implicitTags: string[] = [], |
| 417 | implicitAttrs: {[k: string]: string[]} = {}, |
| 418 | preserveSignificantWhitespace = true, |
| 419 | ): Message[] { |
| 420 | const htmlParser = new HtmlParser(); |
| 421 | const parseResult = htmlParser.parse(html, 'extractor spec', {tokenizeExpansionForms: true}); |
| 422 | if (parseResult.errors.length > 1) { |
| 423 | throw Error(`unexpected parse errors: ${parseResult.errors.join('\n')}`); |
| 424 | } |
| 425 | |
| 426 | return extractMessages( |
| 427 | parseResult.rootNodes, |
| 428 | implicitTags, |
| 429 | implicitAttrs, |
| 430 | preserveSignificantWhitespace, |
| 431 | ).messages; |
| 432 | } |
no test coverage detected
searching dependent graphs…