Socket
Socket
Sign inDemoInstall

react-native-github-markdown

Package Overview
Dependencies
4
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-github-markdown

Generate GitHub Flavored Markdown (with syntax highlight) using React Native WebView


Version published
Weekly downloads
29
decreased by-25.64%
Maintainers
1
Install size
2.77 MB
Created
Weekly downloads
 

Readme

Source

React Native Github Markdown

npm version npm download

Generate GitHub Flavored Markdown (with syntax highlight) using React Native WebView.

Screenshot 📱 👇

Features

  • Render GitHub Flavored Markdown on your React Native WebView.

  • Auto-height WebView adjusted to the document.

  • Code syntax highlighting.

  • Dark mode!

Install

npm i react-native-github-markdown

or

yarn add react-native-github-markdown

Your React Native configuration should support react-native-webview.

Usage

import MarkdownWebView from 'react-native-github-markdown';

<MarkdownWebView
  style={{marginTop: 10}}
  content={'# React Native Github Markdown\n\nHello world!'}
  highlight
  darkMode
/>;

Props

  • defaultHeight: default height when the actual height has not been computed.
  • content: raw markdown content to render.
  • highlight: whether to use highlight.js for syntax highlighting.
  • darkMode: whether to set rendered results in dark mode.

Caveats

  • I haven't found any working HTML sanitizer for React Native, so you should always treat unknown input source carefully. Do proper sanitization yourself if possible.
  • Code syntax highlighting seems odd for long code snippets. It's a problem with highlight.js. You can choose to disable it using the highlight prop.

Behind the Scene

Keywords

FAQs

Last updated on 15 Oct 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc