Skip to content

Commit

Permalink
mg-wp-api: Remove <style> elements from content
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAdamDavis committed Feb 6, 2025
1 parent 55e65ef commit f87d9aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/mg-wp-api/lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ const processContent = async ({html, excerptSelector, featureImageSrc = false, f
$(toc).remove();
});

// <style> blocks don't belong in content - codeinjection_head is the place for these
$html('style').each((i, el) => {
$(el).remove();
});

if (excerptSelector) {
$html(excerptSelector).first().each((i, excerpt) => {
$(excerpt).remove();
Expand Down

0 comments on commit f87d9aa

Please sign in to comment.