New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-for-markdown-loader

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-for-markdown-loader

require a md file as a React Component

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

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

react-for-markdown-loader

Convert Markdown file to React Component using markdown-it.

Installation

npm i react-for-markdown-loader -D

Feature

  • Hot reload
  • Write React script
  • Code highlight

Usage

webpack.config.js file:

module.exports = {
  module: {
    loaders: [{
      test: /\.md/,
      loader: 'react-for-markdown-loader'
    }]
  }
};

Options

reference markdown-it

{
// markdown-it config
  preset: 'default',
  breaks: true,

  preprocess: function(markdownIt, source) {
  // do any thing
    return source
  },
  use: [
  /* markdown-it plugin */
    require('markdown-it-xxx'),
  /* or */
    [require('markdown-it-xxx'), 'this is options']
  ]
}

Or you can customize markdown-it

var markdown = require('markdown-it')({
  html: true,
  breaks: true
})

markdown
  .use(plugin1)
  .use(plugin2, opts, ...)
  .use(plugin3);

module.exports = {
  module: {
    loaders: [{
      test: /\.md/,
      loader: 'react-for-markdown-loader'
    }]
  }

};

Run Example

git clone https://github.com/skidxjq/react-for-markdown-loader
cd react-for-markdown-loader
npm run example
open http://localhost:8080

Note

Resource references can only use absolute path

FAQs

Package last updated on 12 Aug 2017

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