Gatsby plugin for Remark to remove HTML comments from the markdown output
npm install gatsby-remark-remove-comments[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
This is a plugin for gatsby-transformer-remark that removes HTML comments from the processed output.
It's just the Gatsby version of remark-remove-comments.
npm:
``bash`
npm install gatsby-remark-remove-comments
In gatsby-config.js, add:
`diff`
module.exports = {
plugins: [
{
resolve: 'gatsby-transformer-remark',
options: {
+ plugins: [
+ 'gatsby-remark-remove-comments',
+ ],
},
},
],
};
By default, in Remark, HTML comments in Markdown will appear in the output, this plugin removes them.
For the following Markdown file:
`markdownHello World
This is a markdown file, with text in it.
`
Before adding the plugin
` This is a markdown file, with text in it.html`Hello World
After adding the plugin
` This is a markdown file, with text in it.html``Hello World
MIT © https://alvin.codes/
[downloads-badge]: https://img.shields.io/npm/dm/gatsby-remark-remove-comments.svg
[downloads]: https://www.npmjs.com/package/gatsby-remark-remove-comments
[size-badge]: https://img.shields.io/bundlephobia/minzip/gatsby-remark-remove-comments.svg
[size]: https://bundlephobia.com/result?p=gatsby-remark-remove-comments