#2069: Table issue with template and heading
--------------------------------------------+-------------------------------
  Reporter:  360R8                          |       Owner:                    
      Type:  Bug                            |      Status:  new               
  Priority:  Normal                         |   Milestone:                    
 Component:  Project : MediaWiki+FCKeditor  |     Version:  FCKeditor 2.5.1   
Resolution:                                 |    Keywords:  Confirmed HasPatch
--------------------------------------------+-------------------------------
Changes (by wwalc):

  * keywords:  Confirmed => Confirmed HasPatch

Comment:

 I'm attaching a patch. It relies on a hook that doesn't exist yet. With
 this patch, if template is inside of a tag, it is not surrounded by a
 `<span>` tag. It is also required to tell Sanitizer to not remove our
 special word that is replaced with the template content at the end of
 processing, that's why new hook is necessary.


 In `includes/Sanitizer.php`, function `fixTagAttributes`, add this before
 the last line (with return statement):
 {{{
 if ( !wfRunHooks( 'SanitizerAfterFixTagAttributes', array( $text,
 $element, &$attribs ) ) ) {
         return '';
 }
 }}}

 it should look similar to:

 {{{
 static function fixTagAttributes( $text, $element ) {
         if( trim( $text ) == '' ) {
                 return '';
         }

         $stripped = Sanitizer::validateTagAttributes(
                 Sanitizer::decodeTagAttributes( $text ), $element );

         $attribs = array();
         foreach( $stripped as $attribute => $value ) {
                 $encAttribute = htmlspecialchars( $attribute );
                 $encValue = Sanitizer::safeEncodeAttribute( $value );

                 $attribs[] = "$encAttribute=\"$encValue\"";
         }
         if ( !wfRunHooks( 'SanitizerAfterFixTagAttributes', array( $text,
 $element, &$attribs ) ) ) {
                 return '';
         }
         return count( $attribs ) ? ' ' . implode( ' ', $attribs ) : '';
 }
 }}}

 Let me know if that worked for you.

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/2069#comment:4>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to