New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@slimr/markdown

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slimr/markdown

A tiny markdown parser and react component

latest
Source
npmnpm
Version
2.1.89
Version published
Weekly downloads
14
366.67%
Maintainers
1
Weekly downloads
 
Created
Source

🪶 @slimr/markdown npm package

A tiny markdown parser and react component

Context

@slimr is a set of slim React (hence '@slimr') libs. Check them all out on github!

API

parse

Converts a limited markdown subset to HTML

  • 2Kb zipped, 1kb when bundled with other code
  • ...is very small relatively speaking
  • Keeps bundle small by clever coding and not supporting every markdown feature

Supported Syntax

  • headings, i.e. # H1, ## H2, ### H3, #### H4, ##### H5, ###### H6
  • alt H1 heading, i.e. H1\n===
  • alt H2 heading, i.e. H1\n---
  • Horizontal rule/lines, i.e. *** --- ___
  • bold
  • italic
  • strikethrough
  • links, i.e. Link Link with title
  • reference links, i.e. [link1-text][link1-ref]
  • images, i.e. Image Image with title
  • ordered and unordered lists up to one level. nesting not supported.
  • code blocks
  • Most HTML is passed through without modification, except scripts/style which will be HTML encoded

Common alternatives: snarkdown, markdown-it, marked

import {parse} from '@slimr/markdown'

const html = parse(`
  # ~~The Jungle~~Heaven

  Welcome to ~~the jungle~~heaven, baby.
`)

Markdown

A component that displays markdown as html, using src/parse for conversion

Paremeters:

  • applyCodeSyntaxHighlights: Whether to apply syntax highlighting to code blocks. Uses highlight.js which is lazy loaded but HUGE (~20kb). So, if you don't need it, don't use it.
  • src: A string containing markdown to be displayed
import {Markdown} from '@slimr/markdown'

function MyComponent() {
  return (
    <Markdown
      src={`
    # ~~The Jungle~~Heaven

    Welcome to ~~the jungle~~heaven, baby.
  `}
    />
  )
}

Keywords

markdown

FAQs

Package last updated on 30 Dec 2025

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