Skip to content

rehype plugins cause errors #315

Open
@jonasfroeller

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions