16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/morrigan_editor_rails.rb', line 16
def self.sanitize_config
{
:elements => WHITELIST_ELEMENTS,
:attributes => {
'a' => ['href'],
'p' => ['style'],
'img' => ['src', 'style'],
'iframe' => ['width', 'height', 'src', 'frameborder', 'allowfullscreen', 'wmode', 'style'],
'div' => ['style', 'contenteditable', 'class'],
'h2' => ['style'],
'h3' => ['style'],
'h4' => ['style']
},
:css => {
:properties => ['max-width', 'max-height', 'width', 'height', 'font-size', 'font-weight', 'color', 'font-family', 'text-align']
},
:protocols => {
'a' => {'href' => ['http', 'https', 'mailto', 'ftp']}
}
}
end
|