From: Mark P. <Mar...@uf...> - 2008-03-04 18:06:52
|
Krang 2.005 Has anyone else seen Krang strip SPAN attributes? The wysiwyg editor is retaining the attributes yet after I publish the article the attribute is missing. We have a scrubber set up to strip some tags and attributes from being read into the wysiwyg editor, however, the style attribute of the SPAN tag is not one of them. Here is the section of the editor module. <...snip....> # This method exists to strip HTML tags from MS Word. We use extreme # prejudice here and remove everything except a small set of allowed values # which correspond exactly to the buttons on the WYSIWYG editor. sub load_query_data { my ( $self, %arg ) = @_; my ( $query, $element ) = @arg{qw(query element)}; my ($param) = $self->param_names( element => $element ); my $raw_html = scalar $query->param($param); # don't allow anything by default my @default = ( 0, # strip all tags { '*' => 0, }, # strip all attributes ); # allow these tags, but only certain attributes my @rules = ( <...snip...> span => { style => 1, class => 1, id => 1, }, <...snip...> Here is the code that is in the story: <h1><span style="font-size: 20pt; font-weight: bold; color: rgb(255, 0, 0); text-align: center;">This web page uses inline styles.</span></h1> Here is what appears on the page in the 'view source': <!--wysiwyg--> <h1><strong>This web page uses inline styles.</strong></h1> <!--wysiwyg--> Mark T. Pearson Manager of Web Administration <blocked::http://www.uft.org/> UFT Welfare Fund <mailto:mtp...@uf...> mar...@uf... 52 Broadway, 8th Floor New York, NY 10004 (212) 539-0605 ******************************************************************************* The views, opinions, and judgments expressed in this message are solely those of the author. The message contents have not been reviewed or approved by the UFT Welfare Fund. ******************************************************************************* |