File: elements.rb

package info (click to toggle)
ruby-loofah 2.0.3-2%2Bdeb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 500 kB
  • sloc: ruby: 1,972; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'set'

module Loofah
  module Elements
    # Block elements in HTML4
    STRICT_BLOCK_LEVEL = Set.new %w[address blockquote center dir div dl
      fieldset form h1 h2 h3 h4 h5 h6 hr isindex menu noframes
      noscript ol p pre table ul]

    # The following elements may also be considered block-level elements since they may contain block-level elements
    LOOSE_BLOCK_LEVEL = Set.new %w[dd dt frameset li tbody td tfoot th thead tr]

    BLOCK_LEVEL = STRICT_BLOCK_LEVEL + LOOSE_BLOCK_LEVEL
  end

  ::Loofah::MetaHelpers.add_downcased_set_members_to_all_set_constants ::Loofah::Elements
end