Skip to content

Commit

Permalink
fix(head): fix noscript content attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed Aug 18, 2023
1 parent e5fb909 commit e580fe2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
7 changes: 7 additions & 0 deletions src/module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 0 additions & 9 deletions src/runtime/classes/FontCollection.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/utils/description.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export function getStyleDescription(children, noScript = false) {
}
}

export function getNoScriptDescription(innerHTML) {
export function getNoScriptDescription(textContent) {
return {
innerHTML
textContent
};
}

0 comments on commit e580fe2

Please sign in to comment.