def element_preview_code(element)
      if respond_to?(:tag_options)
        tag_options(element_preview_code_attributes(element))
      else
        # Rails 5.1 uses TagBuilder
        tag_builder.tag_options(element_preview_code_attributes(element))
      end
    end
def element_preview_code(element)
      if respond_to?(:tag_options)
        tag_options(element_preview_code_attributes(element))
      else
        # Rails 5.1 uses TagBuilder
        tag_builder.tag_options(element_preview_code_attributes(element))
      end
    end
Renders the HTML tag attributes required for preview mode.