vue.filter('escape_html', function (value) { window.debug && window.debug.filters && console.log(value); return he.encode(value); });
// Convert URLs to embed code Promise.all(queue) .then((result) => { $('[data-auto-embed]').each(function(index) { let embed; if(result[index].embed && result[index].embed.html) { // An embed provider was found, insert the HTML embed = result[index].embed.html; } else { // No embed provider, insert a preview instead embed = result[index].preview; } // Swap out the placeholder element with the embed code $(this).replaceWith( '<div data-embed="true" data-embed-provider="' + He.encode(result[index].site_name, { useNamedReferences: true }) + '">' + embed + '</div>' ); }); // Return the updated HTML resolve($.html()); }) .catch((err) => reject(err));
<script data-postleaf-editor="scripts" src="` + He.encode(script, { useNamedReferences: true }) + `" ></script> `;