MCPcopy Index your code
hub / github.com/angular/angular / _extractMessages

Function _extractMessages

packages/compiler/test/i18n/i18n_parser_spec.ts:414–432  ·  view source on GitHub ↗
(
  html: string,
  implicitTags: string[] = [],
  implicitAttrs: {[k: string]: string[]} = {},
  preserveSignificantWhitespace = true,
)

Source from the content-addressed store, hash-verified

412}
413
414export 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}

Callers 5

i18n_ast_spec.tsFile · 0.90
_humanizeMessagesFunction · 0.85
_humanizePlaceholdersFunction · 0.85

Calls 4

parseMethod · 0.95
extractMessagesFunction · 0.90
ErrorInterface · 0.85
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…