Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

expanded relaxed tags to be more inclusive

  • Loading branch information...
commit 7148395e904a93ed45e3dc8aa383f50b174080f4 1 parent 3411c3a
authored April 09, 2012

Showing 1 changed file with 23 additions and 4 deletions. Show diff stats Hide diff stats

  1. 27  lib/htmlfilter.rb
27  lib/htmlfilter.rb
@@ -134,18 +134,37 @@ class HTMLFilter
134 134
 
135 135
   # Relaxed settings allows a great deal of HTML spec.
136 136
   #
137  
-  # TODO: Need to expand upon RELAXED options.
138  
-  #
139 137
   RELAXED = {
140 138
     'allowed' => {
141 139
       'a'    => ['class', 'href', 'target'],
142 140
       'b'    => ['class'],
143 141
       'i'    => ['class'],
144  
-      'img'  => ['class', 'src', 'width', 'height', 'alt'],
  142
+      'img'  => ['class', 'src', 'width', 'height', 'alt', 'id', 'align', 'border'],
145 143
       'div'  => ['class'],
146 144
       'pre'  => ['class'],
147 145
       'code' => ['class'],
148  
-      'ul'   => ['class'], 'ol' => ['class'], 'li' => ['class']
  146
+      'ul'   => ['class'], 'ol' => ['class'], 'li' => ['class'],
  147
+      'blockquote'  => ['class'],
  148
+      'dl'  => ['class'], 'dt'  => ['class'], 'dd'  => ['class'],
  149
+      'h1'  => ['class'], 'h2'  => ['class'], 'h3'  => ['class'], 'h4'  => ['class'],
  150
+      'h5'  => ['class'], 'h6'  => ['class'],
  151
+      'p'  => ['class'],
  152
+      'table'  => ['class', 'border', 'width', 'height', 'cellpadding', 'cellspacing'],
  153
+      'thead'  => ['class', 'align', 'valign'],
  154
+      'tfoot'  => ['class', 'align', 'valign'],
  155
+      'tbody'  => ['class', 'align', 'valign'],
  156
+      'tr'  => ['class', 'align', 'valign'],
  157
+      'th'  => ['class', 'nowrap', 'width', 'align', 'valign', 'colspan', 'rowspan'],
  158
+      'td'  => ['class', 'nowrap', 'width', 'align', 'valign', 'colspan', 'rowspan'],
  159
+      'col'  => ['class', 'width', 'align', 'valign'],
  160
+      'colgroup'  => ['class', 'width', 'align', 'valign'],
  161
+      'hr'  => '',
  162
+      'br'  => '',
  163
+      'span'  => ['class'],
  164
+      'u'  => ['class'],
  165
+      's'  => ['class'],
  166
+      'strong'  => ['class'],
  167
+      'em'  => ['class'],
149 168
     },
150 169
     'no_close' => ['img', 'br', 'hr'],
151 170
     'always_close' => ['a', 'b'],

0 notes on commit 7148395

Please sign in to comment.
Something went wrong with that request. Please try again.