packages/mdast-util-to-bemjson/lib/transform.js
function(node, entity, props, content) {
        const hasContent = (!entity || entity.content !== null) && content !== null;
        const entityContent = hasContent ?
            ((entity && entity.content) || content || traverse.children(transform, node)) :
            null;
        const block = parseBemNode(entity);
        const bemNode = build(block, props, entityContent);

        // Extend blocks context with external plugins hContext
        if (node.data) {
            node.data.htmlAttributes && (bemNode.attrs = Object.assign({}, bemNode.attrs, node.data.htmlAttributes));
            node.data.hProperties && (bemNode.hProps = node.data.hProperties);
        }

        return transform.augment(bemNode);
    }
function(node, entity, props, content) {
        const hasContent = (!entity || entity.content !== null) && content !== null;
        const entityContent = hasContent ?
            ((entity && entity.content) || content || traverse.children(transform, node)) :
            null;
        const block = parseBemNode(entity);
        const bemNode = build(block, props, entityContent);

        // Extend blocks context with external plugins hContext
        if (node.data) {
            node.data.htmlAttributes && (bemNode.attrs = Object.assign({}, bemNode.attrs, node.data.htmlAttributes));
            node.data.hProperties && (bemNode.hProps = node.data.hProperties);
        }

        return transform.augment(bemNode);
    }
function ( node , entity , props , content ) { const hasContent = ( ! entity || entity . content !== null ) && content !== null ; const entityContent = hasContent ? ( ( entity && entity . content ) || content || traverse . children ( transform , node ) ) : null ; const block = parseBemNode ( entity ) ; const bemNode = build ( block , props , entityContent ) ; // Extend blocks context with external plugins hContext if ( node . data ) { node . data . htmlAttributes && ( bemNode . attrs = Object . assign ( { } , bemNode . attrs , node . data . htmlAttributes ) ) ; node . data . hProperties && ( bemNode . hProps = node . data . hProperties ) ; } return transform . augment ( bemNode ) ; }
Transform MDAST node to bemNode

@param {Object} node - MDAST node
@param {Object} entity - bem entity, partial representation of bemNode
@param {Object} [props] - bemNode properties
@param {Object|Array|String} [content] - bemNode content
@returns {Object} bemNode
Transform MDAST node to bemNode