Skip to content

Commit

Permalink
fix: skip empty content utility (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmkx committed Dec 13, 2021
1 parent bcd50d8 commit 54fc77f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/utilities/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ function stroke(utility: Utility, { theme }: PluginUtils): Output {
}

function content(utility: Utility, { theme }: PluginUtils): Output {
if (!utility.raw.startsWith('content-'))
if (!/^content-(?!$)/.test(utility.raw))
return;
return utility.handler
.handleBody(theme('content'))
Expand Down
2 changes: 1 addition & 1 deletion test/processor/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ describe('Utilities', () => {
});

it('content utilities', () => {
expect(processor.interpret('content-πŸ‘ before:content-["πŸ‘"] content-open-quote after:content-[attr(value)] content').styleSheet.build()).toMatchSnapshot('css');
expect(processor.interpret('content-πŸ‘ before:content-["πŸ‘"] content-open-quote after:content-[attr(value)] content content-').styleSheet.build()).toMatchSnapshot('css');
});

// #216
Expand Down

0 comments on commit 54fc77f

Please sign in to comment.