Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-remark-unwrap-images

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-remark-unwrap-images

Unwrap remark images nodes from paragraph nodes

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gatsby-remark-unwrap-images

npm package

Usecase

gatsby-remark-unwrap-images is usefull if your want to style paragraphs and images differently.

You can easily have full width images and margin around texts to have a Medium style posts.

div {
    p {
        max-width: 1000px;
        margin: 0 auto;
    }

    img {
        width: 100%;
    }
}

With gatsby-remark-unwrap-images

Hello Word!

![](image1.jpg)
![](image2.jpg)

The previous markdown will generate the following DOM:

<div>
  <p>Hello Word!</p>
  <img src="image1.jpg" />
  <img src="image2.jpg" />
</div>

Without gatsby-remark-unwrap-images

Hello Word!

![](image1.jpg)
![](image2.jpg)

The previous markdown will generate the following DOM:

<div>
  <p>Hello Word!</p>
  <p>
    <img src="image1.jpg" />
    <img src="image2.jpg" />
  </p>
</div>

Getting started

gatsby-remark-unwrap-images

You can download gatsby-remark-unwrap-images from the NPM registry via the npm or yarn commands

yarn add gatsby-remark-unwrap-images
npm install gatsby-remark-unwrap-images --save

Usage

Add the plugin in your gatsby-config.js file:

module.exports = {
    plugins: [
        {
            resolve: "gatsby-transformer-remark",
            options: {
                plugins: ["gatsby-remark-unwrap-images"],
            },
        },
    ],
}

Contributing

  • ⇄ Pull/Merge requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.

See CONTRIBUTING.md guidelines

Changelog

See CHANGELOG.md

License

This project is licensed under the MIT License - see the LICENCE.md file for details

Keywords

FAQs

Package last updated on 25 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc