<commit_before>require 'redcarpet'

module Spree
  module Retail
    class RedcarpetHTMLRenderer
      def initialize(options: {}, extensions: {})
        @options = options
        @extensions = extensions

        @renderer = Redcarpet::Render::HTML.new(default_options)
        @converter = Redcarpet::Markdown.new(@renderer, default_extensions)
      end

      def render(content)
        converter.render(content).strip
      end

      private

      attr_accessor :options, :extensions, :renderer, :converter<commit_msg>Return an empty string if product's content is nil<commit_after>require 'redcarpet'

module Spree
  module Retail
    class RedcarpetHTMLRenderer
      def initialize(options: {}, extensions: {})
        @options = options
        @extensions = extensions

        @renderer = Redcarpet::Render::HTML.new(default_options)
        @converter = Redcarpet::Markdown.new(@renderer, default_extensions)
      end

      def render(content)
        return '' if content.nil?
        converter.render(content).strip
      end

      private

      attr_accessor :options, :extensions, :renderer, :converter
{'fraction_non_alphanumeric': 0.09139307897071872, 'fraction_numerical': 0.0, 'mean_word_length': 3.0869565217391304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4328139', 'n_tokens_mistral': 314, 'n_tokens_neox': 302, 'n_words': 72}