Skip to content

Commit

Permalink
Fix support for Eruda v3.2.0
Browse files Browse the repository at this point in the history
The function util.classPrefix is no longer available via exports.
  • Loading branch information
JingMatrix committed Jul 16, 2024
1 parent 89dd55a commit 47e5133
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/src/main/assets/eruda.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,20 @@ class Filter {
}
}

const c = eruda.util.classPrefix;
function c(str) {
const prefix = `eruda-`;
return str
.trim()
.split(/\s+/)
.map((singleClass) => {
if (singleClass.includes(prefix)) {
return singleClass;
}
return singleClass.replace(/[\w-]+/, (match) => `${prefix}${match}`);
})
.join(" ");
}

const s = (spans) =>
spans
.map((e) => `<span class="${c("icon-" + e + " " + e)}"></span>`)
Expand Down

0 comments on commit 47e5133

Please sign in to comment.