import escapeHTML from 'escape-html' import {type Request} from 'express' export function linkWarningContents( req: Request, opts: { type: 'warn' | 'block' link: string }, ): string { const continueButton = opts.type === 'warn' ? `${req.__('Continue Anyway')}` : '' return `
${ opts.type === 'warn' ? req.__( 'This link may be malicious. You should proceed at your own risk.', ) : req.__( 'This link has been identified as malicious and has blocked for your safety.', ) }
${escapeHTML(opts.link)}