Skip to content

Commit 425cfb6

Browse files
fix: styles not applied if style tag is empty
1 parent 930f26b commit 425cfb6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export class Magician {
7474
}
7575
if (ast && !ast.css) {
7676
this.content += '\n<style>\n</style>\n'
77+
} else if (ast && (ast.css.content.start == ast.css.content.end)) {
78+
this.content = this.content.replace("<style></style>", "<style>\n</style>")
7779
}
7880

7981
return this

0 commit comments

Comments
 (0)