Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Extra whitespace around markup generates <undefined> element warning #23

@michalkvasnicak

Description

@michalkvasnicak

Basically the problem is similar to borgfriend/gatsby-remark-embed-video#20. It's caused by whitespace around markup generated by this plugin.

Quick workaround is to use customMarkup with defaultMarkup function and then just trim() the result.

{
      resolve: 'gatsby-plugin-mdx',
      options: {
        gatsbyRemarkPlugins: [
          {
            resolve: 'gatsby-remark-images-anywhere',
            options: {
              createMarkup: (...args) => defaultMarkup(...args).trim(),
              quality: 100,
              maxWidth: 960,
            },
          },
          {
            resolve: 'gatsby-remark-embedder',
          },
        ],
        remarkPlugins: [require('remark-unwrap-images')],
      },
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions