HTML5::Token
A Token consists of a TokenType and some data (tag name for start and end tags, content for text, comments and doctypes). A tag Token may also contain an array of Attributes. data is unescaped for all Tokens (it looks like "a<b" rather than "a<b"). For tag Tokens, data_atom is the atom for data, or zero if data is not a known tag name.
Constructors
new(type : HTML5::TokenType = TokenType::Error, data_atom : HTML5::Atom::Atom = Atom::Atom.zero, data : String = "", attr : Array(HTML5::Attribute) = Array(Attribute).new(0))
SourceInstance methods
attr
Sourcedata
Sourcedata_atom
Sourcedata_atom=(data_atom : Atom::Atom)
SourceAppends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.
type
Sourcetype=(type : TokenType)
Source