Sha256: e45c2ded1db50da0036aab1f85539340bf4b3e385208270e29adcb4a6eed0fd5
Contents?: true
Size: 595 Bytes
Versions: 11
Compression:
Stored size: 595 Bytes
Contents
# frozen_string_literal: true module EffectiveArticleEditorHelper def render_article_editor_action_text_content(content) raise('expected content to be an ActionText content') unless content.kind_of?(ActionText::Content) rendered = render_action_text_content(content) if rendered.include?('effective-article-editor') doc = Nokogiri::HTML(rendered) doc.search('action-text-attachment').each { |fragment| fragment.remove } # Filter out <html><body>\n and \n</body></html> rendered = doc.inner_html.to_s[13..-16].html_safe end rendered end end
Version data entries
11 entries across 11 versions & 1 rubygems