Support 'string' components for matching, which then get directly
rendered.
Showing
1 changed file
with
3 additions
and
2 deletions
... | @@ -18,10 +18,11 @@ for (const [ matcher, handler ] of replacers) { | ... | @@ -18,10 +18,11 @@ for (const [ matcher, handler ] of replacers) { |
18 | } | 18 | } |
19 | 19 | ||
20 | const nextDebug = debug ? debug - 1 : 0 | 20 | const nextDebug = debug ? debug - 1 : 0 |
21 | const [ Component, componentArgs ] = Array.isArray(slotName) ? slotName : [] | 21 | const [ Component, componentArgs, componentContent ] = Array.isArray(slotName) ? slotName : [] |
22 | --- | 22 | --- |
23 | { | 23 | { |
24 | Component ? (<Component {...componentArgs} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>) | 24 | typeof Component === 'string' ? <Component {...node.attributes} {...componentArgs}>{componentContent}</Component> |
25 | : Component ? (<Component {...componentArgs} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>) | ||
25 | : slotName ? slotHandler(slotName, node, special) | 26 | : slotName ? slotHandler(slotName, node, special) |
26 | : <Node parent={parent} node={node} index={index} debug={nextDebug} replacers={replacers} slotHandler={slotHandler} special={special}/> | 27 | : <Node parent={parent} node={node} index={index} debug={nextDebug} replacers={replacers} slotHandler={slotHandler} special={special}/> |
27 | } | 28 | } | ... | ... |
-
Please register or sign in to post a comment