Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Fix one RegExp for parsing "@import" method correctly.#32

Closed
7happy7 wants to merge 3 commits intojotform:masterfrom
7happy7:master
Closed

Fix one RegExp for parsing "@import" method correctly.#32
7happy7 wants to merge 3 commits intojotform:masterfrom
7happy7:master

Conversation

@7happy7
Copy link

@7happy7 7happy7 commented Jul 25, 2020

new RegExp('@import .*?;','gi') cannot parse some Google Fonts' URL:

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;1,300&display=swap');

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;

This bug can be fixed by changing the RegExp to new RegExp('@import (?:url\\(.*?\\)|).*?;','gi') (/@import (?:url\(.*?\)|).*?;/gi).

@7happy7 7happy7 changed the title Fix one RegExp for "@import" parsing correctly. Fix one RegExp for parsing "@import" method correctly. Jul 25, 2020
@eeertekin eeertekin closed this Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants