Class: Canon::Formatters::Html5Formatter

Inherits:
HtmlFormatterBase show all
Defined in:
lib/canon/formatters/html5_formatter.rb

Overview

HTML5 formatter using Nokogiri::HTML5 parser

Constant Summary

Constants inherited from HtmlFormatterBase

Canon::Formatters::HtmlFormatterBase::BLOCK_ELEMENTS, Canon::Formatters::HtmlFormatterBase::WHITESPACE_SENSITIVE_ELEMENTS

Class Method Summary collapse

Methods inherited from HtmlFormatterBase

canonicalize, format

Class Method Details

.parse(html) ⇒ Nokogiri::HTML5::Document

Parse HTML5 document

Parameters:

  • html (String)

    HTML document to parse

Returns:

  • (Nokogiri::HTML5::Document)

    Parsed HTML5 document



12
13
14
# File 'lib/canon/formatters/html5_formatter.rb', line 12

def self.parse(html)
  Nokogiri::HTML5(html)
end