From e580fe2272a8fe66cf84ef9d60f3b86f295f554d Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Fri, 18 Aug 2023 09:30:48 +0200 Subject: [PATCH] fix(head): fix noscript content attribute --- src/module.mjs | 7 +++++++ src/runtime/classes/FontCollection.mjs | 9 --------- src/runtime/utils/description.mjs | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/module.mjs b/src/module.mjs index 43cdf55101..26ad02f5c3 100644 --- a/src/module.mjs +++ b/src/module.mjs @@ -53,6 +53,13 @@ export default defineNuxtModule({ setPublicRuntimeConfig(nuxt, moduleOptions); + // TODO: Remove in future + if (isWebpackBuild(nuxt)) { + logger.warn( + `[${MODULE_NAME}]: Webpack build is not usable yet.\nOpen Issues:\n- Inline Styles (\`https://nuxt.com/docs/api/configuration/nuxt-config#inlinessrstyles\`)` + ); + } + if (moduleOptions.detection.performance && nuxt.options.ssr) { if (isWebpackBuild(nuxt)) { nuxt.hook( diff --git a/src/runtime/classes/FontCollection.mjs b/src/runtime/classes/FontCollection.mjs index 8ab215225c..ef39d428f2 100644 --- a/src/runtime/classes/FontCollection.mjs +++ b/src/runtime/classes/FontCollection.mjs @@ -23,15 +23,6 @@ export default class FontCollection { return rootSelector; } - getHeadDescription(critical, crossorigin) { - return { - link: this.getPreloadDescriptions(critical, crossorigin), - style: this.getStyleDescriptions(), - noscript: this.getNoScriptStyleDescriptions(), - __dangerouslyDisableSanitizers: ['style', 'noscript'] - }; - } - getPreloadDescriptions(critical, crossorigin = 'anonymous') { return Array.from( this.list diff --git a/src/runtime/utils/description.mjs b/src/runtime/utils/description.mjs index 5e3cf48b32..099773f4a0 100644 --- a/src/runtime/utils/description.mjs +++ b/src/runtime/utils/description.mjs @@ -74,8 +74,8 @@ export function getStyleDescription(children, noScript = false) { } } -export function getNoScriptDescription(innerHTML) { +export function getNoScriptDescription(textContent) { return { - innerHTML + textContent }; }