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

react-markdown-github

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-markdown-github

React component that renders Markdown similarly to Github's formatting

  • 3.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
73
increased by180.77%
Maintainers
4
Weekly downloads
 
Created
Source

react-markdown-github

A React component that wraps react-markdown that:

  • links all headers with an anchor link.
  • resolves all relative links to absolute Github URLs based on the sourceUri of the document.
  • allows the parent component to override the resolved url.

Installation

npm install react-markdown-github

Usage

<MarkdownGithub 
  source={ markdown } 
  sourceUri='https://github.mycorp.com/org/component/blob/master/README.md'  
  transformLinkUri={ ({ uri, github, org, repo, filename, filepath }) => { } }
  transformImageUri={ ({ uri, github, org, repo, filename }) => {} }
  renderers={ code: myCodeFormatter } 
  className='myClass' />

Component Properties

  • sourceUri Absolute URL to orgional markdown. All relative links will be resolved relative to this URL.
  • transformLinkUri URL resolver function. To override the URL resolver and point a url to an alternate location.
  • transformImageUri image URL resolver function. Default behavior is to not modify image urls.
  • renderers An object of render function values with keys corresponding to Node Type to be passed to react-markdown.
  • className the CSS class passed to react-markdown.

Test

npm test
LICENSE: MIT

Keywords

FAQs

Package last updated on 20 Aug 2019

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