useHead with scripts, how set html attribute to ="true"
I have problem with the useHead composable. I need to add a script tag in vue3 which has a html attribute set to 'true', this should render as ="true" but renders as ="".
I can see that this is done intentionally https://github.com/unjs/unhead/blob/main/packages/unhead/src/utils/normalise.ts function normaliseProps line 57.
This behaviour changed from nuxt 3 rc11 to rc12 in a useHead refactor. Before that it worked as expected.
Bug? Any solution hot to get raw html in the head? App.html doesn't work anymore in nuxt3.
GitHub
unhead/normalise.ts at main · unjs/unhead
△ Universal document tag manager. Tiny, adaptable and full-featured. - unhead/normalise.ts at main · unjs/unhead
2 Replies
That's interesting, I think you can create an issue in the unhead repo for this
Since I think
true
(the string) should be usable as attribute
And if not we will know the reason for that.thanks for the response. I opened a bug https://github.com/unjs/unhead/issues/103
GitHub
useHead with scripts, how set html attribute to ="true" · Issue #10...
Environment "dependencies": { "@vueuse/core": "^9.10.0", "debounce": "^1.2.1", "graphql":...