Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal JS doesn't process properly with multiple keys #67

Closed
o-alexandrov opened this issue Mar 18, 2017 · 5 comments
Closed

Internal JS doesn't process properly with multiple keys #67

o-alexandrov opened this issue Mar 18, 2017 · 5 comments

Comments

@o-alexandrov
Copy link

Hello, I'm using nuxt and trying to add internal JS in JSON-LD format.
For the purpose to be short, I added just a couple of properties in the example. Without __dangerouslyDisableSanitizers: ['script'], it doesn't process " leaving it as "

export default {
  head () {
    return {
      script: [
        { innerHTML: '{ "@context": "http://www.schema.org", "@type": "Organization" }', type: 'application/ld+json' }
      ],
      __dangerouslyDisableSanitizers: ['script']
    }
  }
}
@ezhkov
Copy link

ezhkov commented Mar 23, 2017

The same thing. Documentation says that we should use __dangerouslyDisableSanitizers(['script']) but in that case I get console error
vue-meta-error
On debugging I see the following data
vue-meta-error2
vue-meta-error3

And then updateTags function crashes

@atinux atinux self-assigned this Mar 25, 2017
@devyfriend
Copy link

is this issue resolved yet ?

@atinux
Copy link
Member

atinux commented May 15, 2017

Should be fixed now :)

@atinux atinux closed this as completed May 15, 2017
@o-alexandrov
Copy link
Author

o-alexandrov commented Jun 8, 2017

@atinux Thank you for partially fixing it. I have just checked it and the problem still exists. I haven't tested on a pure vue.js project, here are observations using latest nuxt.alpha4:

Surprisingly, after hot-reload only it does properly render the innerHTML of the script.

However, it fails to render " on the initial render and quotes are still left as "
npm run generate, static generation also doesn't produce correct JSON-LD, leaving quotes as "

@ghost
Copy link

ghost commented May 18, 2018

I can confirm @OlzhasAlexandrov findings and it only renders properly after hot-reload only. Fails to render on initial render and npm run generate.

@atinux atinux removed their assignment Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants