{"repo":"TheBeyondGroup/shopify-rich-text-renderer","free":true,"listed":false,"github":"https://github.com/TheBeyondGroup/shopify-rich-text-renderer","clone":"git clone https://github.com/TheBeyondGroup/shopify-rich-text-renderer.git","description":"A package to convert Shopify's rich text schema to an HTML string","language":"JavaScript","stars":71,"topics":["javascript","metaobject","shopify","rich-text-to-html","rich-text","rich-text-serializer","metafields"],"license":"MIT","category":"ecommerce","readme_excerpt":"Shopify Rich Text Renderer This package converts the rich text schema returned by Shopify's Storefront API to an HTML string. In particular, this package is useful when dealing with the rich text field type for MetaObjects and Metafields when using the Storefront API. Supports all of Shopify's Richtext Editor markup, including new line characters, and both bold & italic on the same text node. Usage - Install yarn add @thebeyondgroup/shopify-rich-text-renderer - Then import the convertSchemaToHtml() function To get scoped HTML pass either true or the name of a class(es) to use in your scoped css selectors in the scoped property of the options parameter (options.scoped). This allows for the rich text HTML to be easily styled. Note: You can also pass a scoped class name or true (to use default scoped class) instead of the options object, i.e. convertSchemaToHtml(richTextResponse, 'rich-text-wrap') . You can also pass in a custom class name to be used as the scoped class instead of the default rte . If you want to be more specific or are using something like Tailwind CSS you can pass a string of classes to be used with specific HTML elements to the classes property of the options parameter (options.classes). This makes it easy to write your own wrapper class to apply a default classlist to various elements. There is also an option to convert new line character's to (You can create new lines using shift + space in Shopify's rich text editor). React Typescript Component Example Exa","default_branch":null,"files":null,"tree":[],"storefront":"/r/TheBeyondGroup","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/TheBeyondGroup/shopify-rich-text-renderer/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."}