Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f7398eea
authored
2025-02-03 15:40:36 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Support 'string' components for matching, which then get directly
rendered.
1 parent
fbafd335
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
lib/match.astro
lib/match.astro
View file @
f7398ee
...
...
@@ -18,10 +18,11 @@ for (const [ matcher, handler ] of replacers) {
}
const nextDebug = debug ? debug - 1 : 0
const [ Component, componentArgs ] = Array.isArray(slotName) ? slotName : []
const [ Component, componentArgs
, componentContent
] = Array.isArray(slotName) ? slotName : []
---
{
Component ? (<Component {...componentArgs} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>)
typeof Component === 'string' ? <Component {...node.attributes} {...componentArgs}>{componentContent}</Component>
: Component ? (<Component {...componentArgs} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>)
: slotName ? slotHandler(slotName, node, special)
: <Node parent={parent} node={node} index={index} debug={nextDebug} replacers={replacers} slotHandler={slotHandler} special={special}/>
}
...
...
Please
register
or
sign in
to post a comment