unhead icon indicating copy to clipboard operation
unhead copied to clipboard

JSON like escaping for title instead of HTML like

Open holtwick opened this issue 2 years ago • 3 comments

Environment

node 20, mac m1, vite5, vue, vite-ssg

Reproduction

useHead({
  title: `Tag "${tag}"`,
})

Produces Tag \"tag\"

Describe the bug

Quotes in title get escaped to \". Should be ".

Additional context

No response

Logs

No response

holtwick avatar Dec 15 '23 10:12 holtwick

As far as I could tell this is no longer the case, can you make a reproduction if you are able to still replicate it.

harlan-zw avatar Mar 04 '24 02:03 harlan-zw

Having the same issue. Can we reopen please @harlan-zw ?

useSeoMeta({
    title: 'Test "123"',
  });

Becomes: Test \"123\"

I am on latest Nuxt 3.12.3 which uses latest unhead 1.9.16

MickL avatar Jul 15 '24 13:07 MickL

Can confirm this is still happening. This particularly sucks for us because most of our meta titles contain double quotes.

jfern01 avatar Jul 22 '24 12:07 jfern01

I've tried to replicate this without any success. If anyone can provide a reproduction using the latest it would be helpful.

harlan-zw avatar Aug 19 '24 14:08 harlan-zw

Here's an example of the issue.. Running latest nuxt with @nuxtjs/seo version 2.0.0-rc.18.

jfern01 avatar Aug 19 '24 18:08 jfern01

Thanks but I can't do anything with this, I need to be able to reproduce it locally to fix the issue.

harlan-zw avatar Aug 19 '24 23:08 harlan-zw

I can no longer reproduce the error either. IMO the bug is fixed. Thanks.

holtwick avatar Aug 20 '24 06:08 holtwick

I am still having the same issue, I am on latest @nuxtjs/seo, unhead 1.9.16. Both me and @jfern01 reported this issue in july, I dont think it has been fixed. Can you reopen?

MickL avatar Aug 20 '24 10:08 MickL

I'm happy to re-open once there's a reproduction available I can use to fix the issue, I can't reproduce it so I can't fix it.

harlan-zw avatar Aug 20 '24 11:08 harlan-zw