@makerinc/react-sdk
    Preparing search index...

    Function renderDescription

    • Renders product/variant descriptions with HTML support, escape sequences, and template variables

      This function handles:

      • HTML rendering with dangerouslySetInnerHTML
      • Literal backslash sequence conversion (\r, \n, \t) to actual escape sequences
      • Template variable substitution (${product.id}, ${variant.id})
      • Whitespace preservation with pre-wrap

      Parameters

      Returns ReactElement

      import { renderDescription } from '@makerinc/react-sdk';

      function ProductCard({ product }) {
      return (
      <div>
      <h2>{product.name}</h2>
      {renderDescription({
      text: product.description || '',
      product,
      isRichText: true,
      isPreWrapped: true
      })}
      </div>
      );
      }