Skip to content

Commit

Permalink
fix: 修复获取 css 的正则表达式
Browse files Browse the repository at this point in the history
  • Loading branch information
KonghaYao committed May 23, 2024
1 parent 03c1c34 commit 99d527c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/subsets/src/utils/getSubsetsFromCSS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const getSubsetsFromCSS = (css: string): Subsets => {
const list = css.match(/@font-face[\s\S]+?\}/g);
if (!list) return [];
return list.map((face) => {
const unicodeList = face.match(/unicode-range:(.*(?:[,;]))+/);
const unicodeList = face.match(/unicode-range:([\s\S]*(?:[,;]))+/);
if (!unicodeList) return [];
const range = unicodeList[1];
return range
Expand Down

0 comments on commit 99d527c

Please sign in to comment.