/* global Handlebars, html_sanitize*/ import cajaSanitizers from 'ghost/utils/caja-sanitizers'; var formatHTML = Ember.Handlebars.makeBoundHelper(function (html) { var escapedhtml = html || ''; // replace script and iFrame escapedhtml = escapedhtml.replace(/)<[^<]*)*<\/script>/gi, '
Embedded JavaScript
'); escapedhtml = escapedhtml.replace(/)<[^<]*)*<\/iframe>/gi, '
Embedded iFrame
'); // sanitize HTML escapedhtml = html_sanitize(escapedhtml, cajaSanitizers.url, cajaSanitizers.id); return new Handlebars.SafeString(escapedhtml); }); export default formatHTML;