We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28972ba commit fae6b04Copy full SHA for fae6b04
src/common/themes.js
@@ -145,9 +145,13 @@
145
async getContentCSS() {
146
contentCSS = contentCSS || (async () => {
147
const replaceAsync = async (string, regexp, replacerFunction) => {
148
- const replacements = await Promise.all(
149
- Array.from(string.matchAll(regexp),
150
- match => replacerFunction(...match)));
+ regexp.lastIndex = 0;
+ const promises = [];
+ for (let match; match = regexp.exec(string);) {
151
+ promises.push(replacerFunction(...match));
152
+ }
153
+ const replacements = await Promise.all(promises);
154
155
let i = 0;
156
return string.replace(regexp, () => replacements[i++]);
157
}
0 commit comments