Skip to content

Commit

Permalink
Quick check for undefined s4
Browse files Browse the repository at this point in the history
  • Loading branch information
niktek committed Sep 21, 2022
1 parent d81dea2 commit 874945a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/package/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function strip_lang_tags(content) {
.replace(
/(<!--[^]*?-->)|(<script[^>]*?)\s(?:type|lang)=(["'])(.*?)\3/g,
// things like application/ld+json should be kept as-is. Preprocessed languages are "ts" etc
(match, s1, s2, _, s4) => (s4.startsWith('application/') ? match : (s1 ?? '') + (s2 ?? ''))
(match, s1, s2, _, s4) => (s4?.startsWith('application/') ? match : (s1 ?? '') + (s2 ?? ''))
)
.replace(/(<!--[^]*?-->)|(<style[^>]*?)\s(?:type|lang)=(["']).*?\3/g, '$1$2');
}
Expand Down

0 comments on commit 874945a

Please sign in to comment.