This package provides a DOM/XML parser for React Native, Titanium, and browser environments, based on the `xmldom` library. The current and only stable version is 0.1.0, which was last published over 6 years ago. It aims to offer a W3C DOM Level 2 Core-compatible API, including `DOMParser` and `XMLSerializer`, along with `xmldom`-specific extensions for error handling. Due to its age and lack of maintenance, it is unlikely to be compatible with modern JavaScript, Node.js, or React Native environments and may contain unpatched security vulnerabilities inherited from its `xmldom` dependency. Developers should consider more actively maintained alternatives for parsing HTML in React Native.
npm install react-native-html-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates parsing an HTML string, querying elements using various methods like `querySelect` and `getElementsByTagName`, and briefly shows the document structure. Note that `XMLSerializer` import might need adjustment depending on the exact build environment.
Migrate to a currently maintained HTML parsing library designed for React Native, such as `html-react-parser` or `@react-native-html/parser`.
Due to the abandoned status of `react-native-html-parser`, there are no direct fixes. Users must migrate to an alternative library that is actively maintained and addresses `xmldom`'s security issues or uses a different parsing engine.
If attempting to use this package in an old React Native project, ensure React Native imports are compatible with the specific version of React Native in use. For new projects, avoid this package entirely.
Thoroughly test parsing results for critical use cases. Consider alternatives based on more robust parsers like `parse5` (e.g., `react-native-parse-html`).
Check the HTML/XML source for invalid or unsupported entities. Ensure character encoding is correctly specified if external sources are being parsed. Refer to the linked GitHub issue for potential workarounds or to preprocess HTML.