🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
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

latest
Source
npmnpm
Version
1.0.2
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

gatsby

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