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

react-highlight-codeblock

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-highlight-codeblock

syntax highlighting component for react-syntax-highlighter with highlightjs ast using inline styles

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

React Highlight CodeBlock

Syntax highlighting component based on react-syntax-highlighter development.

Install

npm install react-highlight-codeblock --save

Usage

import CodeBlock from 'react-highlight-codeblock'

Syntax highlighting of single code snippet

<CodeBlock
    code={strCode}
    callback={code => console.log(code)}
    editer={true}
    language="html"
    style="monokai"
    showLineNumbers={false}
/>

props

  • code - code snippet presentation and editing.
  • editer - default to false, is it editable.
  • style - the style to highlight code in. Available options here for hljs.do not use the default style.
  • language - the language to highlight code in. Available options here for hljs .
  • callback is used with the editer attribute as a post-edit callback function.
  • showLineNumbers if this is enabled line numbers will be shown next to the code block.

Keywords

react

FAQs

Package last updated on 15 Oct 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