1.4.0 • Published 10 months ago

github-style-markdown v1.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

github-style-markdown

  • An NPM library that handles GitHub markdown-style text.
  • Remember that you have to write your own CSS stylesheet to imitate the below screenshot's aesthetics.
  • A replacement for react-markdown package.

npm version


Installing

  • Using NPM: npm install github-style-markdown
  • Using Yarn: yarn install github-style-markdown

Usage

  • In React, you can call it by
import React from 'react';
import parseMarkdown from 'github-style-markdown';

const MyComponent = () => {
  const markdownText = `
  # Hello, world!
  This is **bold** and this is *italic*.
  > This is a quote.
  `;

  const htmlText = parseMarkdown(markdownText);

  return (
    <div dangerouslySetInnerHTML={{ __html: htmlText }} />
  );
};

export default MyComponent;
  • In Vanilla JS, call it by
const parseMarkdown = require('github-style-markdown');

const markdownText = `
# Hello, world!
This is **bold** and this is *italic*.
> This is a quote.
`;

const htmlText = parseMarkdown(markdownText);

console.log(htmlText);
1.4.0

10 months ago

1.3.0

11 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.0.0

11 months ago