Skip to content

Commit

Permalink
fix: font-family is case insensitive (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Mar 18, 2023
1 parent 61c3e3f commit 8aa3fac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/clone-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export async function cloneNode<T extends Node>(
cloneStyle.getPropertyValue('font-family')
.split(',')
.filter(Boolean)
.map(val => val.toLowerCase())
.forEach(val => fontFamilies.add(val))

copyPseudoContent(node, clone, ownerWindow)
Expand Down
1 change: 1 addition & 0 deletions src/embed-web-font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export async function embedWebFont<T extends Element>(
&& cssRule.style.getPropertyValue('font-family')
.split(',')
.filter(Boolean)
.map(val => val.toLowerCase())
.some(val => fontFamilies.has(val))
))
.forEach((value) => {
Expand Down

1 comment on commit 8aa3fac

@vercel
Copy link

@vercel vercel bot commented on 8aa3fac Mar 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

modern-screenshot – ./

modern-screenshot.vercel.app
modern-screenshot-git-main-qq15725.vercel.app
modern-screenshot-qq15725.vercel.app

Please sign in to comment.