Skip to content

Commit

Permalink
馃悰 style銇屾畫銈嬨儛銈般伄淇
Browse files Browse the repository at this point in the history
  • Loading branch information
r74tech committed Nov 1, 2023
1 parent 9031ace commit 435d777
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/script/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ const handleMessage = (event) => {
const cleanedHtml = html.replace(/<wj-body class="wj-body">/g, '').replace(/<\/wj-body>/g, '');
const pageStyles = document.getElementById('page-styles');
if (styles.length > 0 && pageStyles) {
styles.forEach((style: string) => {
const styleEl = document.createElement('style');
styleEl.textContent = style;
pageStyles.appendChild(styleEl);
});
setInnerHtml(
pageStyles,
styles.map((v) => `<style>\n${v.replace(/</g, '&lt;')}\n</style>`).join('\n\n')
);
}

setInnerHtml(targetContent, cleanedHtml);
Expand Down

0 comments on commit 435d777

Please sign in to comment.