wooorm / parse-entities

Parse HTML character references
MIT License
49 stars 12 forks source link

Document.createElement not present in webworker #20

Closed stevemk14ebr closed 2 years ago

stevemk14ebr commented 2 years ago

Hello, I am using remark in a web worker. This library assumes that document.createelement is always present, which breaks this workflow. This issue was introduced in the recent commit: https://github.com/wooorm/parse-entities/commit/2e7da3036e40742f121d8a1b4fdc10b2b9e50da7

before this change there were no issues with this.

https://github.com/wooorm/parse-entities/blob/6d7cef95baa04c3430f929cb017b541f54b9e863/lib/decode-entity.browser.js#L5

Upon loading any webworker using remark, that transitively includes parse-entities, the web worker will immediately fault throwing an exception about document being undefined.

wooorm commented 2 years ago

Hey! Duplicate of https://github.com/wooorm/parse-entities/issues/19. Please discuss there.