Closed pilotmoon closed 11 months ago
@ccordoui would you accept a PR that fixes this single line preventing Turndown from running in web workers?
@Radiergummi it will patch the case of the undefined window, unfortunately as we don't have access to DOM in a service worker, it would need more work to be fully functional.
I ended up repeating the html to markdown process in all part of my web extension and the service worker only communicate in json.
Turndown can be used in DOM-less environments without further modification by using a DOM library such as linkedom.
Met the same issue when trying to use turndown in a service worker
I have the same issue - I had to fork the library and fix it with:
if (root.ActiveXObject) useActiveX = true;
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch
turndown@7.1.1
for the project I'm working on.I'm running turndown in a macOS app using JavaScriptCore, which is an environment without a
window
object. Turndown works great except for one line where it reference thewindow
object. It was a simple fix to add a guard expression.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.