Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-remark-line-breaks

Add support for hard line breaks to gatsby-transformer-remark, powered by remark-breaks.

How to install

$ npm i gatsby-remark-line-breaks

When do I use this plugin?

By default, you should have two or more spaces before new lines for line breaks in Markdown. For those who are more familiar with GitHub Flavored Markdown might find it inconvenient. This Remark transformer plugin will put hard line breaks without needing spaces while translating Markdown into HTML.

foo
baz
<p>foo<br>
baz</p>

You will find more information about hard line breaks on GitHub Flavored Markdown Spec here.

Examples of usage

plugins: [
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
          `gatsby-remark-line-breaks`
      ]
    }
  },

How to run tests

$ npm test
© 2024 Gatsby, Inc.