{"repo":"remarkablemark/html-react-parser","free":true,"listed":false,"github":"https://github.com/remarkablemark/html-react-parser","clone":"git clone https://github.com/remarkablemark/html-react-parser.git","description":"📝 HTML to React parser.","language":"TypeScript","stars":2424,"topics":["html-react-parser","react-parser","react","html","dom","parse","parser","javascript","jsx","typescript"],"license":"MIT","category":"ui-components","readme_excerpt":"html-react-parser HTML to React parser that works on both the server (Node.js) and the client (browser): The parser converts an HTML string to one or more React elements. To replace an element with another element, check out the replace option. Example StackBlitz TypeScript JSFiddle Examples Table of Contents - Install - Usage - replace - replace with TypeScript - replace element and children - replace element attributes - replace and remove element - transform - library - htmlparser2 - trim - trustedTypePolicy - Migration - v5 - v4 - v3 - v2 - v1 - FAQ - Is this XSS safe? - Does invalid HTML get sanitized? - Are tags parsed? - Attributes aren't getting called - Parser throws an error - Is SSR supported? - Elements aren't nested correctly - Don't change case of tags - TS Error: Property 'attribs' does not exist on type 'DOMNode' - Can I enable trim for certain elements? - Webpack build warnings - TypeScript error - Performance - Contributors - Code Contributors - Financial Contributors - Individuals - Organizations - Support - License Install NPM: Yarn: CDN: Usage Import ES module: Or require CommonJS module: Parse single element: Parse multiple elements: Make sure to render parsed adjacent elements under a parent element: Parse nested elements: Parse element with attributes: replace The replace option allows you to replace an element with another element. The replace callback's first argument is domhandler's node: Console output The element is replaced if a valid React eleme","default_branch":null,"files":null,"tree":[],"storefront":"/r/remarkablemark","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/remarkablemark/html-react-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}