Never Program Mad

    @stnew/markdown

    0.0.13 • Public • Published

    Markdown

    A React component for parsing and rendering a markdown string, with support for custom tags that map to React components.

    Examples

    // string
    const exampleString = "## test";
    
    // React
    <Markdown content={exampleString} />
    
    // renders
    <h2>test</h2>
    
    //string
    const exampleString = `
    ## test
    <ComponentA />
    <ComponentB className="test">children</ComponentB>
    `;
    
    // React
    import ComponentA from './ComponentA';
    import ComponentB from './ComponentB';
    
    <Markdown
      content={exampleString}
      customTags={{
        ComponentA,
        ComponentB,
      }}
    />
    
    // renders
    <h2>test</h2>
    <ComponentA />
    <ComponentB className="test">children</ComponentB>
    
    

    Keywords

    none

    Install

    npm i @stnew/markdown

    DownloadsWeekly Downloads

    0

    Version

    0.0.13

    License

    MIT

    Unpacked Size

    15.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • artofrawr
    • cabe
    • returningsam
    • ryanhefner