/** * @module preview */ import { renderPopup } from '../popup/popup'; import { escapeHTML } from '../templateUtil'; /** * @param {ext.popups.PreviewModel} model * @param {boolean} showTitle * @param {string} extractMsg * @param {string} linkMsg * @return {string} HTML string. */ export function renderPreview( { title, url, type }, showTitle, extractMsg, linkMsg ) { title = escapeHTML( title ); extractMsg = escapeHTML( extractMsg ); linkMsg = escapeHTML( linkMsg ); return renderPopup( type, `
${ showTitle ? `${ title }` : '' } ${ extractMsg } ` ); }