module HtmlConditionalComment

Constants

VERSION

Public Class Methods

lex(html) click to toggle source

Tokenize the HTML into an array of tokens

# File lib/html-conditional-comment.rb, line 13
def lex(html)
  Lexer.new(html).tokenize()
end
parse(html) click to toggle source

Parse into tree of nodes the HTML

# File lib/html-conditional-comment.rb, line 20
def parse(html)
  Parser.new(self.lex(html)).parse()
end
to_string(html, features, version) click to toggle source

Evaluate conditional comments in HTML using the supplied browser information and return a string

  • features - String or Array of features of browser

  • version - String, Integer, or Float representing version of the browser

# File lib/html-conditional-comment.rb, line 31
def to_string(html, features, version)
  self.parse(html).accept(Visitors::ToString.new(features, version))
end