kopia lustrzana https://github.com/cheeaun/phanpy
Fix cloak mode issues on Safari
rodzic
014e694a4a
commit
8d98ccff83
|
@ -290,6 +290,17 @@ function _enhanceContent(content, opts = {}) {
|
|||
}
|
||||
}
|
||||
|
||||
// FIX CLOAK MODE FOR SAFARI
|
||||
// Workaround for Safari so that `text-decoration-thickness` works
|
||||
// Wrap child text nodes in spans
|
||||
for (const node of dom.childNodes) {
|
||||
if (node.nodeType === Node.TEXT_NODE) {
|
||||
const span = document.createElement('span');
|
||||
span.textContent = node.textContent;
|
||||
dom.replaceChild(span, node);
|
||||
}
|
||||
}
|
||||
|
||||
if (postEnhanceDOM) {
|
||||
queueMicrotask(() => postEnhanceDOM(dom));
|
||||
// postEnhanceDOM(dom); // mutate dom
|
||||
|
|
Ładowanie…
Reference in New Issue