mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-08 17:22:26 +03:00
feat: new @bbob/html api (#4)
This commit is contained in:
committed by
GitHub
parent
bf993813fc
commit
575c1bb932
@@ -1,3 +1,4 @@
|
||||
import core from '@bbob/core';
|
||||
import { attrValue } from '@bbob/plugin-helper';
|
||||
|
||||
/**
|
||||
@@ -48,5 +49,7 @@ const renderNodes = (nodes, { stripTags = false } = {}) => []
|
||||
.concat(nodes)
|
||||
.reduce((r, node) => r + renderNode(node, { stripTags }), '');
|
||||
|
||||
const toHTML = (source, plugins) => core(plugins).process(source, { render: renderNodes }).html;
|
||||
|
||||
export const render = renderNodes;
|
||||
export default renderNodes;
|
||||
export default toHTML;
|
||||
|
||||
Reference in New Issue
Block a user