Skip to content

Commit

Permalink
fix: disable sanitizer for amp custom style
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jan 10, 2021
1 parent f3bbea6 commit 063dc14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function (ctx, inject) {
const { head } = ctx.app
// Disable sanitizer
head.__dangerouslyDisableSanitizersByTagID = head.__dangerouslyDisableSanitizersByTagID || {}
head.__dangerouslyDisableSanitizersByTagID['amp-custom'] = ['innerHTML']
head.__dangerouslyDisableSanitizersByTagID['amp-custom'] = ['cssText']

const cssText = await import('!!raw-loader<%= options.cssLoader %>!<%= options.css %>').then(m => m.default || m)
head.style.push({ cssText, type: 'text/css', hid: 'amp-custom' })
Expand Down

0 comments on commit 063dc14

Please sign in to comment.