awinogradov / posthtml-bemjson

Convert PostHTML tree to BEMJSON tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PostHTML-bemjson

npm version

PostHTML plugin to convert PostHTML tree to BEMJSON tree

Usage

var posthtml = require('posthtml'),
    html = '<html><head><title>Wow</title></head><body><div class="button"><div class="button__text">Text</div></div></body></html>';

var bemjson = posthtml()
    .use(require('posthtml-bemjson'))
    .process(html, { sync: true }).tree;

Test

npm run test

About

Convert PostHTML tree to BEMJSON tree


Languages

Language:JavaScript 100.0%