def initialize(draft = "")
Utility::check_types({ draft=>String }) if $DEBUG
@id = -1
@attrs = {}
@dtexts = []
@htexts = []
if draft.length
lines = draft.split(/\n/)
num = 0
while num < lines.length
line = lines[num]
line = line.gsub(/[ \t\r\n\v\f]+/, " ")
line = line.lstrip.rstrip.squeeze(" ")
num += 1
break if line.length < 1
next if line =~ /^%/
if idx = line.index("=")
key = line[0...idx]
value = line[idx+1...line.length]
@attrs[key] = value
end
end
while num < lines.length
line = lines[num]
next unless line.length
if line[0] == '\t'
@htexts.push(line)
else
@dtexts.push(line)
end
num += 1
end
end
end