Class: PageHub::Markdown::Embedder::PageHubProcessor
- Defined in:
- lib/pagehub-markdown/processors/embedder.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ PageHubProcessor
constructor
A new instance of PageHubProcessor.
- #process(content, uri, args = "") ⇒ Object
Methods inherited from Processor
Constructor Details
#initialize ⇒ PageHubProcessor
Returns a new instance of PageHubProcessor.
197 198 199 |
# File 'lib/pagehub-markdown/processors/embedder.rb', line 197 def initialize() super(["pagehub", /pagehub.org/]) end |
Instance Method Details
#process(content, uri, args = "") ⇒ Object
201 202 203 204 205 206 207 208 |
# File 'lib/pagehub-markdown/processors/embedder.rb', line 201 def process(content, uri, args = "") html_doc = Nokogiri::HTML(content) do |config| config.noerror end node = html_doc.xpath("//div[@id='content']").first node.xpath('div[@id="breadcrumbs"]').remove node.xpath('div[@id="bottom"]').remove stamp(node, uri, 'pagehub') node end |