Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-remark-attr

npm version

Add attributes to MarkdownRemark using remark-attr.

Install

npm install --save gatsby-remark-attr

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: 'gatsby-transformer-remark',
    options: {
      plugins: [
        'gatsby-remark-attr'
      ],
    },
  },
]

// allowDangerousDOMEventHandlers option
plugins: [
  {
    resolve: 'gatsby-transformer-remark',
    options: {
      plugins: [
        {
          resolve: "gatsby-remark-attr",
          options: {
            allowDangerousDOMEventHandlers: true
          },
        },
      ],
    },
  },
]

Images

// input
![alt](src){width=100 height=50}

// output
<img src="src" alt="alt" width="100" height="50">
// input
[Gatsby](https://github.com/gatsbyjs/gatsby){rel="external"}

// output
<a href="https://github.com/gatsbyjs/gatsby" rel="external">Gatsby</a>

Options

Options

© 2023 Gatsby, Inc.