-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The RegExp used to match tags are too greedy. If the source file has, for example, multiple link or script tags on the same line, you'll often get garbage output. As a result, inline-scripts won't run on something built by preact/webpack.
For sure RegExp isn't really the best way to parse HTML, but I was able to make following change (.* to [^>]*), which seems to work around this issue.
const linkTagRegex = /<link (?:[^>]* )?rel="stylesheet"(?:[^>]* )?href="([\w.\-\/]+)"[^>]*>|<link (?:[^>]* )?href="([\w.\-\/]+)"(?:[^>]* )?rel="stylesheet"[^>]*>/;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels