wooorm / parse-entities

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

Support React Native, use the normal decode-entity #15

Closed staltz closed 5 years ago

staltz commented 5 years ago

react-markdown (which supports React Native nowadays) requires remark-parse which requires parse-entities, and the React Native bundler seems to pick up (for some reason) the replacement field "browser" in package.json, which throws an error because decode-entity.browser.js uses document, and that's not present in React Native.

This PR adds the replacement field "react-native" in package.json, which in the React Native bundler takes priority over "browser", to use the default decode-entity.js file. I tested this solution in an actual RN app and it works.

wooorm commented 5 years ago

Sweet, thanks! 👍