1.0.3 • Published 4 years ago

use-marked-hook v1.0.3

Weekly downloads
32
License
MIT
Repository
github
Last release
4 years ago

useMarked() hook

A react hook for parsing markdown with marked and sanitize-html

NPM JavaScript Style Guide

Live Demo

The app located at /example demonstrates how it could be used, see the live result at https://this-fifo.github.io/use-marked-hook/

Install

yarn add use-marked-hook

Usage

import React from "react";
import { useMarked } from "use-marked-hook";

const App = () => {
  const markdown = `**bold content**`;
  const html = useMarked(markdown);
  // html -> <p></strong>bold content</strong></p>
  return <div dangerouslySetInnerHTML={{ __html: html }} />;
};

License

MIT © Filipe Herculano


1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago