Socket
Book a DemoInstallSign in
Socket

gatsby-remark-figure-caption

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-remark-figure-caption

transform markdown image to figure with caption element

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
386
6.63%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-remark-figure-caption

Package Version Build Status Code Coverage MIT licensed

transforms: ![image with description](path-to-image.jpg) into:

<figure>
  <img src="path-to-image.jpg">
  <figcaption>image with description</figcaption>
</figure>

Install

npm install --save gatsby-remark-figure-caption

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
        {
          resolve: `gatsby-remark-figure-caption`,
          options: {figureClassName: 'md-figure'},
        },
      ],
    },
  },
]

Options

NameDefaultDescription
figureClassName''class for the wrapper figure element
imageClassName''class for the wrapped img element
captionClassName''class for the wrapped figcaption element

Disclaimers

only tested with gatsby v2, it may work on v1.

not really a good thing a11y-wise:

  • images should have a descriptive alt, that can replace it.
  • created for working around cripled markdown tools.
  • there are better ways to describe an image.

PRs welcome.

Keywords

gatsby

FAQs

Package last updated on 30 Sep 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.