Module: MaRuKu::HTMLFragment

### Home Classes Methods

### In Files

- lib/maruku/html.rb

### Methods

- ::new

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::AttributeList
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::HTMLElement
- MaRuKu::HTMLFragment
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::MDHTMLElement
- MaRuKu::MDLine
- MaRuKu::NokogiriHTMLFragment
- MaRuKu::Out
- MaRuKu::Out::EntityTable
- MaRuKu::Out::HTML
- MaRuKu::Out::HTML::HTMLElement
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::MDDocumentExtensions
- MaRuKu::Out::Markdown
- MaRuKu::REXMLHTMLFragment
- MaRuKu::Section
- MaRuKu::Strings
- Maruku
- Maruku::In
- Maruku::In::Markdown
- Maruku::In::Markdown::FencedCode
- Object
- String
- Textile2Signature

No matching classes.

# MaRuKu::HTMLFragment

This is just a factory, not an actual class

### Public Class Methods

new(raw_html) click to toggle source

HTMLFragment.new produces a concrete HTMLFragment implementation that is either a NokogiriHTMLFragment or a REXMLHTMLFragment.

    # File lib/maruku/html.rb, line 31
    def self.new(raw_html)
      if !$warned_nokogiri && MaRuKu::Globals[:html_parser] == 'nokogiri'
        begin
          require 'nokogiri'
          return NokogiriHTMLFragment.new(raw_html)
        rescue LoadError
          warn "Nokogiri could not be loaded. Falling back to REXML."
          $warned_nokogiri = true
        end
      end

      require 'rexml/document'
      REXMLHTMLFragment.new(raw_html)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.