Ignore:
Timestamp:
05/10/09 16:02:03 (3 years ago)
Author:
MichaelTempest
Message:

Item1535: Inserted span elements when WYSIWYG_TT class is applied to other elements. Added unit tests to replicate fault.

Also updated the internal test documentation in TranslatorTest.pm. (CDot: Thanks for explaining things)

Added explicit event handlers for each type of event generated by HTML::Parser, to eliminate the empty text elements generated from the start_document and end_document events. The default event handler should never be called, now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML.pm

    r2957 r3875  
    6666 
    6767    my $this = new HTML::Parser( 
    68         start_h       => [ \&_openTag,  'self,tagname,attr' ], 
    69         end_h         => [ \&_closeTag, 'self,tagname' ], 
    70         declaration_h => [ \&_ignore,   'self' ], 
    71         default_h     => [ \&_text,     'self,text' ], 
    72         comment_h     => [ \&_comment,  'self,text' ] 
     68        start_h          => [ \&_openTag,  'self,tagname,attr' ], 
     69        end_h            => [ \&_closeTag, 'self,tagname' ], 
     70        text_h           => [ \&_text,     'self,text' ], 
     71        comment_h        => [ \&_comment,  'self,text' ], 
     72        declaration_h    => [ \&_ignore,   'self' ], 
     73        start_document_h => [ \&_ignore,   'self' ], 
     74        end_document_h   => [ \&_ignore,   'self' ], 
     75                default_h        => [ \&_default,  'self,event,text' ] 
    7376    ); 
    7477 
     
    220223} 
    221224 
     225sub _default { 
     226        my ( $this, $event, $text ) = @_; 
     227    # Unexpected $event event from HTML::Parser; text contains '$text' 
     228        ASSERT(0); 
     229} 
     230 
    222231sub _apply { 
    223232    my ( $this, $tag ) = @_; 
Note: See TracChangeset for help on using the changeset viewer.