markdown2jsx v1.0.3
Markdown parser in React
this module converts Markdown into JSX. It is composed of one function:
function MarkDown2JSX(src: String, MDstyle: Object, srcCodeFunction: Function, listFunction: Function, allowHTML: Boolean): Arrayand that function takes 4 parameters:
src: the Markdown source codeMDstyle: the styles object composed out of class-names strings with wich you can style some of the markdown components.these components are:
headerlinkcodeBlockblockQuoteBackgroundblockQuoteLeftBorderinlineCodeBlockbolditaliclinethroughbulletListtableEach one of these Markdown Components can be given custom styles by giving them a class-name and then defining that class-name in a CSS file.
srcCodeFunction: call back function meant to style the source code within a code block. (optional)the srcCodeFunction should be a function that looks like this:
function srcCodeFunction(src:String, lan:String): JSXWhere
srcis the source code andlanis the specified language of the source code.listFunction: call back function meant to determine what glyph comes before the text of a bullet list. (optional)
the listFunction should be a function that looks like this:
function listFunction(spaces: Number, value: String): String Where spaces is the indentation or the amount of spaces that comes before a member of a bullet list and value is the text of a particular member of a bullet list.
allowHTML: boolean value that determines if HTML text will be rendered as raw HTML or as raw text
npm install
npm i markdown2jsx
make sure to see the example in order to see all the current markdown features