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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user