Class/Module Index [+]

Quicksearch

HTML5::TreeWalkers::TokenConstructor

Public Instance Methods

_(str) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 54
def _(str)
  str
end
comment(data) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 42
def comment(data)
  {:type => :Comment, :data => data}
end
doctype(name, public_id, system_id, correct=nil) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 46
def doctype(name, public_id, system_id, correct=nil)
  {:type => :Doctype, :name => name, :public_id => public_id, :system_id => system_id, :correct => correct}
end
empty_tag(name, attrs, has_children=false) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 14
def empty_tag(name, attrs, has_children=false)
  error(_("Void element has children")) if has_children
  {:type => :EmptyTag, :name => name, :data => normalize_attrs(attrs)}
end
end_tag(name) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 23
def end_tag(name)
  {:type => :EndTag, :name => name, :data => []}
end
error(msg) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 6
def error(msg)
  {:type => "SerializeError", :data => msg}
end
normalize_attrs(attrs) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 10
def normalize_attrs(attrs)
  attrs.to_a
end
start_tag(name, attrs) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 19
def start_tag(name, attrs)
  {:type => :StartTag, :name => name, :data => normalize_attrs(attrs)}
end
text(data) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 27
def text(data)
  if data =~ /\A([#{SPACE_CHARACTERS.join('')}]+)/
    yield({:type => :SpaceCharacters, :data => $1})
    data = data[$1.length .. -1]
    return if data.empty?
  end

  if data =~ /([#{SPACE_CHARACTERS.join('')}]+)\Z/
    yield({:type => :Characters, :data => data[0 ... -$1.length]})
    yield({:type => :SpaceCharacters, :data => $1})
  else
    yield({:type => :Characters, :data => data})
  end
end
unknown(nodeType) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/base.rb, line 50
def unknown(nodeType)
  error(_("Unknown node type: ") + nodeType.to_s)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.