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

rehype plugins cause errors #315

Open
jonasfroeller opened this issue Dec 20, 2024 · 1 comment
Open

rehype plugins cause errors #315

jonasfroeller opened this issue Dec 20, 2024 · 1 comment

Comments

@jonasfroeller
Copy link

I added the following rehype plugins:

plugins: {
  'rehype-external-links': {
    rel: ['nofollow', 'noopener', 'noreferrer'],
    target: '_blank',
  },
  'rehype-sanitize': {
    strip: ['script', 'style', 'iframe', 'math'],
    protocols: {
      href: ['http', 'https', 'mailto', 'tel'],
      cite: ['http', 'https'],
      src: ['http', 'https'],
    },
    attributes: {
      '*': ['class', 'id'],
      'a': ['href', 'title', 'target', 'rel'],
      'img': ['src', 'alt', 'title', 'width', 'height'],
      'blockquote': ['cite'],
      'code': ['class', 'id'],
    },
    tagNames: [
      'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
      'p', 'br', 'b', 'i', 'strong', 'em',
      'a', 'img', 'pre', 'code', 'ol', 'ul', 'li',
      'blockquote', 'table', 'thead', 'tbody', 'tr', 'th', 'td',
    ],
  },
},

Errors I get:

[22:20:37]  WARN  "plugins" is imported by ".nuxt/mdc-imports.mjs", but could not be resolved – treating it as an external dependency.
[plugin:vite:import-analysis] Failed to resolve import "plugins" from ".nuxt/mdc-imports.mjs". Does the file exist?
@farnabaz
Copy link
Collaborator

farnabaz commented Jan 7, 2025

I couldn't reproduce the issue on my side, Could you provide a simple reproduction for the problem?

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