Skip to content

Commit

Permalink
capricorn86#976@minor: Fixes capricorn86#670 ensuring last ";" in css…
Browse files Browse the repository at this point in the history
…Text.
  • Loading branch information
malko committed Jul 17, 2023
1 parent 4054058 commit 16814c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/happy-dom/src/css/CSSParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export default class CSSParser {
stack.push(parentRule);
} else {
if (parentRule) {
const cssText = css.substring(lastIndex, match.index).trim();
const cssText = css
.substring(lastIndex, match.index)
.trim()
.replace(/([^;])$/, '$1;'); // Ensure last semicolon
switch (parentRule.type) {
case CSSRule.FONT_FACE_RULE:
case CSSRule.KEYFRAME_RULE:
Expand Down

0 comments on commit 16814c8

Please sign in to comment.