In: |
lib/amrita/tag.rb
|
Parent: | TagInfo |
EMPTY | = | Set::new(*%w(area base basefont bgsound br col frame hr img input isindex keygen link meta nextid param spacer wbr)) |
INLINE | = | Set.new(*%w(em tt i b u strike s big small strong dfn code samp kbd var cite abbr acronym sub)) |
BLOCK | = | Set.new(*%w(address dl isindex p blockquote fieldset menu pre center form noframes table dir h1 h2 h3 h4 h5 h6 noscript ul div hr ol)) |
LIST | = | Set.new(*%w(ul ol dir)) |
ITEM | = | Set.new(*%w(li dt dd tr th td)) |
ACCEPT_ANY | = | Set.new(*%w(html head body td)) |
BLOCK_OR_ITEM | = | (BLOCK | ITEM) |
BLOCK_OR_EMPTY | = | (BLOCK | EMPTY) |
CAN_OMIT_ENDTAG | = | Set.new(*%w(html head body p li tr th td thead tbody tfoot colgroup dt dd option)) |
# File lib/amrita/tag.rb, line 280 def initialize super pptype1 = %(html head body table ul ol div br table tr) pptype1.each do |name| get_tag_info(name).pptype = 1 end pptype2 = %(title link meta tr li th td h1 h2 h3 h4 h5 h6 p) pptype2.each do |name| get_tag_info(name).pptype = 2 end empty = %(area base basefont bgsound br col frame hr img input isindex keygen link meta nextid param spacer wbr) empty.each do |name| get_tag_info(name).can_be_empty = true end get_tag_info(:a).set_url_attr(:href) get_tag_info(:base).set_url_attr(:href) get_tag_info(:img).set_url_attr(:src) get_tag_info(:img).set_url_attr(:usemap) get_tag_info(:form).set_url_attr(:action) get_tag_info(:link).set_url_attr(:href) get_tag_info(:area).set_url_attr(:href) get_tag_info(:body).set_url_attr(:background) get_tag_info(:script).set_url_attr(:src) get_tag_info(:object).set_url_attr(:classid) get_tag_info(:object).set_url_attr(:codebase) get_tag_info(:object).set_url_attr(:data) get_tag_info(:object).set_url_attr(:archive) get_tag_info(:object).set_url_attr(:usemap) get_tag_info(:applet).set_url_attr(:codebase) get_tag_info(:applet).set_url_attr(:archive) get_tag_info(:applet).set_url_attr(:usemap) get_tag_info(:q).set_url_attr(:cite) get_tag_info(:blockquote).set_url_attr(:cite) get_tag_info(:ins).set_url_attr(:cite) get_tag_info(:del).set_url_attr(:cite) get_tag_info(:frame).set_url_attr(:longdesc) get_tag_info(:frame).set_url_attr(:src) get_tag_info(:iframe).set_url_attr(:longdesc) get_tag_info(:iframe).set_url_attr(:src) get_tag_info(:head).set_url_attr(:profile) BLOCK.each do |t| get_tag_info(t).tag_class = TagBlock end INLINE.each do |t| get_tag_info(t).tag_class = TagInline end EMPTY.each do |t| get_tag_info(t).tag_class = TagEmpty end LIST.each do |t| get_tag_info(t).tag_class = TagList end ITEM.each do |t| get_tag_info(t).tag_class = TagItem end %(thead tbody tfoot).each do |t| get_tag_info(t).tag_class = TagTableSection end %(dt dd).each do |t| get_tag_info(t).tag_class = TagDT end get_tag_info(:pre).tag_class = TagPre get_tag_info(:p).tag_class = TagP end