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

markdown-it-img-lazy

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

markdown-it-img-lazy

a markdown-it plugin to better supporting image lazy loading

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
99
decreased by-11.61%
Maintainers
1
Weekly downloads
 
Created
Source

markdown-it-img-lazy

a markdown-it plugin to better supporting image lazy loading

The plugin will preferentially use native image lazy-loading, if the browser does not support it, it will be implemented through lozad


Installation

yarn add markdown-it-img-lazy
# or
npm i markdown-it-img-lazy

Usage

md.use(require('markdown-it-img-lazy'), /* Options */)

then you need

load Lozad.js in the head tag of your page

load imgLazy.js closer the </body> tag of your page

![img](/img.jpg)

Options

useNative

  • Type: Boolean
  • Default: true
  • Required: false

Use the native image lazy-loading for the web

if useNative = true
![img](img.jpg) -> <p><img alt="img" data-src="img.jpg" loading="lazy" class="lazy"></p>

if useNative = false
![img](img.jpg) -> <p><img alt="img" data-src="img.jpg" class="lazy"></p>

selector

  • Type: string
  • Default: lazy
  • Required: false

Default class name for image

prefix

  • Type: string Function
  • Default: ''
  • Required: false

Config prefix for src in images

Keywords

FAQs

Package last updated on 08 Oct 2021

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