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

react-toc-hash-link

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-toc-hash-link

Create a table of contents for react hash link from the given markdown text.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

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

: THIS NPM IS BASED ON react-toc

: JUST ADDED url parameter and react-router-hash-link ON HERE

Installation

npm install --save react-toc-hash-link
import React from "react";
import Toc from "react-toc-hash-link";

const Example = () => {
  const yourMarkdownText = "# test \n your markdown Content # test2\n";
  return <Toc markdownText={yourMarkdownText} className={"customClassName"} url={url}/>;
};

export default Example;

: Toc will return a tag as HashLink in react-router-hash-link

: It will make you can use Anchor Link on React Project

Example

const markdownText = '### 3. This is Example';
...
	return <Toc markdownText={markdownText}  url={'/post'}/>;   
    // result : <ul><ul><ul><li><a href="#/post#3.-This-is-Example">3. This is Example</a></li></ul></ul></ul>

:blank will be replace to '-' on href Anchor url (url in url parament has no difference)

: result a tag is adjusted as HashLink in react-router-hash-link

FAQs

Package last updated on 12 Dec 2020

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