Sha256: b4b24d5dc65ab537d4be4eda536ee2353dd7bfec1688869cf086ed93fd369c9d

Contents?: true

Size: 787 Bytes

Versions: 11

Compression:

Stored size: 787 Bytes

Contents

module Html2rss
  module ItemExtractors
    ##
    # Return the HTML of the attribute.
    #
    # Imagine this HTML structure:
    #
    #     <p>Lorem <b>ipsum</b> dolor ...</p>
    #
    # YAML usage example:
    #
    #    selectors:
    #      description:
    #        selector: p
    #        extractor: html
    #
    # Would return:
    #    '<p>Lorem <b>ipsum</b> dolor ...</p>'
    #
    # Always make sure to sanitize the HTML during post processing with
    # {AttributePostProcessors::SanitizeHtml}[rdoc-ref:Html2rss::AttributePostProcessors::SanitizeHtml].
    class Html
      def initialize(xml, options)
        @element = ItemExtractors.element(xml, options)
      end

      ##
      # @return [String]
      def get
        @element.to_s
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
html2rss-0.9.0 lib/html2rss/item_extractors/html.rb
html2rss-0.8.2 lib/html2rss/item_extractors/html.rb
html2rss-0.8.1 lib/html2rss/item_extractors/html.rb
html2rss-0.8.0 lib/html2rss/item_extractors/html.rb
html2rss-0.7.0 lib/html2rss/item_extractors/html.rb
html2rss-0.6.0 lib/html2rss/item_extractors/html.rb
html2rss-0.5.2 lib/html2rss/item_extractors/html.rb
html2rss-0.5.1 lib/html2rss/item_extractors/html.rb
html2rss-0.5.0 lib/html2rss/item_extractors/html.rb
html2rss-0.4.1 lib/html2rss/item_extractors/html.rb
html2rss-0.4.0 lib/html2rss/item_extractors/html.rb