` tag. Defaults to `false`. * @returns The converted HTML string. */ export function mdToHtml(md: string, inline: boolean = false): string { const rawHtml = inline ? markdown.renderInline(md) : markdown.render(md); const safeHtml: string = sanitizeHtml(rawHtml, htmlSanitizeOptions); // Revert some escaped characters for comparison. if (comparableSanitizedHtml(rawHtml) === comparableSanitizedHtml(safeHtml)) { return adjustUrls(safeHtml); } console.debug('Rejected unsafe md:', md); console.error('Rejected unsafe html:', rawHtml); console.error('Rejected unsafe html:', comparableSanitizedHtml(rawHtml)); console.error('Expected safe html:', comparableSanitizedHtml(safeHtml)); throw new Error('Found unsafe html'); }