Skip to content

Xrew/remark-bobril

Repository files navigation

remark-bobril

Plugin to compile Markdown to Bobril using Remark.

Prerequisites

For more information, please check: unified

Installation

  • npm install remark-bobril

Programmatic usage in browser

 import * as remark from 'remark';
 import * as remarkBobril from 'remark-bobril';

 const markdown = '## Hello world';
 
 remark()
    .use(remarkBobril)
    .process(markdown, (_err, bobrilDom) => {
            const result = JSON.stringify(bobrilDom.contents);
            
            console.log(result);
          }
        );

The generated content of variable result is:

{
  tag: 'div',
  children: [
    {
      tag: 'h2',
      children: [
        'Hello world'
      ]
    }
  ]
}

As you can see, there is on more wrapper div element in the result than you can expect. This root element is always generated.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors