Skip to content

Commit

Permalink
fix: fix rendered code tag having trailing space (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
godnondsilva committed Mar 23, 2024
1 parent dd43521 commit 57501e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fixtures/Foo.mist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type BazProps = {

export function Baz({ children, ...props }: BazProps) {
return (
<p {...props} className="Baz" >
<p {...props} className="Baz">
{children}
</p>
)
Expand Down
11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ export function ${name}({ ${[
'...props',
].join(', ')} }: ${name}Props) {
return (
<${component.tag} {...props} className="${name}" ${Object.keys(
component.data,
)
.map((key) => `data-${key}={${key}}`)
.join(' ')}>
<${[
component.tag,
'{...props}',
`className="${name}"`,
...Object.keys(component.data).map((key) => `data-${key}={${key}}`),
].join(' ')}>
{children}
</${component.tag}>
)
Expand Down

0 comments on commit 57501e6

Please sign in to comment.