2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-30 15:24:05 +03:00

feat(react): allow pass custom options to react component

This commit is contained in:
Nikolay Kostyurin
2018-10-25 16:39:49 +02:00
parent 6d37793001
commit 77b30f3d44
3 changed files with 10 additions and 8 deletions
+4 -3
View File
@@ -4,8 +4,9 @@ import * as html from '@bbob/html';
import { isTagNode, isStringNode } from '@bbob/plugin-helper';
const toAST = (source, plugins) => core(plugins)
const toAST = (source, plugins, options) => core(plugins)
.process(source, {
...options,
render: input => html.render(input, { stripTags: true }),
}).tree;
@@ -32,8 +33,8 @@ function renderToReactNodes(nodes) {
return els;
}
function render(source, plugins) {
return renderToReactNodes(toAST(source, plugins));
function render(source, plugins, options) {
return renderToReactNodes(toAST(source, plugins, options));
}
export { render };