Sha256: c75ca9856d6f62118d1c417424866e0efa2bdfc655cabf2c15f9fc6f317f8251
Contents?: true
Size: 958 Bytes
Versions: 10
Compression:
Stored size: 958 Bytes
Contents
require 'reverse_markdown' module Html2rss module AttributePostProcessors ## # Returns HTML code as Markdown formatted String. # Before converting to markdown, the HTML is sanitized with SanitizeHtml. # Imagine this HTML structure: # # <section> # Lorem <b>ipsum</b> dolor... # <iframe src="https://evil.corp/miner"></iframe> # <script>alert();</script> # </section> # # YAML usage example: # # selectors: # description: # selector: section # extractor: html # post_process: # name: html_to_markdown # # Would return: # 'Lorem **ipsum** dolor' class HtmlToMarkdown def initialize(value, env) @value = SanitizeHtml.new(value, env).get end ## # @return [String] formatted in Markdown def get ReverseMarkdown.convert @value end end end end
Version data entries
10 entries across 10 versions & 1 rubygems