in poller-lambdas/src/pollers/ap/parseNitfContent.ts [13:25]
export function nitfBlockToHtml(block: HTMLElement): string {
const clonedBlock = block.clone() as HTMLElement;
for (const hl2 of clonedBlock.querySelectorAll('hl2')) {
hl2.tagName = 'h2';
}
for (const mediaTag of clonedBlock.querySelectorAll('media,media-reference')) {
mediaTag.remove();
}
return clonedBlock.innerHTML
.split('\n')
.map((_) => _.trim())
.join('');
}