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

Markdown doesn't seem to work with newest version of Vditor using jsdelivr cdn. #75

Closed
Niclassg opened this issue Jan 24, 2024 · 1 comment

Comments

@Niclassg
Copy link

Niclassg commented Jan 24, 2024

This projects always gets the latest Vditor plugin by fetching it through the vditor cdn. However it seems like v. 3.9.8 doesn't work and there is no way to adjust the version in this plugin. I can confirm by going into node_modules and update the urls in this plugin to point it https://cdn.jsdelivr.net/npm/vditor@3.9.7/dist/index.min.js and https://cdn.jsdelivr.net/npm/vditor@3.9.7/dist/index.css that it works again.

Ref: Vanessa219/vditor#1244

@cipchk
Copy link
Member

cipchk commented Jan 26, 2024

How to change cdn?

  • If using standalone use provideNuMarkdownConfig({ libs: [] }) to adjust.
  • If using module, use NuMarkdownModule.forRoot({ libs: [] }) to adjust.

The libs parameter should contain index.min.js and index.css, like this:

provideNuMarkdownConfig({ 
  libs: [
    'https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js',
    'https://cdn.jsdelivr.net/npm/vditor/dist/index.css'
  ]
})

In addition, You can also use local path:

// angular.json
{
  "glob": "*.(js|css)",
  "input": "node_modules/vditor/dist",
  "output": "/assets/vditor/"
}

Then modify the libs path:

provideNuMarkdownConfig({ 
  libs: [
    './assets/vditor/index.min.js',
    './assets/vditor/index.css'
  ]
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants