- Timestamp:
- 05/10/09 16:02:03 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
r3396 r3875 363 363 364 364 # Collapse adjacent VERBATIM nodes together 365 # Collapse a <p> tha ncontains only a protected span into a protected P365 # Collapse a <p> that contains only a protected span into a protected P 366 366 # Collapse em in em 367 367 # Collapse adjacent text nodes … … 444 444 } 445 445 446 # If this node has the specified class, insert a new "span" node with that 447 # class between this node and all of this node's children. 448 sub _moveClassToSpan 449 { 450 my $this = shift; 451 my $class = shift; 452 453 if ( $this->{tag} and 454 lc($this->{tag}) ne 'span' and 455 $this->_removeClass($class) ) { 456 457 my $newspan = new Foswiki::Plugins::WysiwygPlugin::HTML2TML::Node( $this->{context}, 'span', { class => $class } ); 458 my $kid = $this->{head}; 459 while ($kid) { 460 $newspan->addChild($kid); 461 $kid = $kid->{next}; 462 } 463 $this->{head} = $this->{tail} = $newspan; 464 } 465 } 466 446 467 # the actual generate function. rootGenerate is only applied to the root node. 447 468 sub generate { … … 487 508 $tag =~ s/!//; # DOCTYPE 488 509 my $tmlFn = '_handle' . uc($tag); 510 511 $this->_moveClassToSpan('WYSIWYG_TT'); 489 512 490 513 # See if we have a TML translation function for this tag … … 839 862 while ($kid) { 840 863 if ( $kid->{tag} eq 'th' ) { 864 $kid->_moveClassToSpan('WYSIWYG_TT'); 841 865 ( $flags, $text ) = $kid->_flatten($options); 842 866 $text = _TDtrim($text); … … 844 868 } 845 869 elsif ( $kid->{tag} eq 'td' ) { 870 $kid->_moveClassToSpan('WYSIWYG_TT'); 846 871 ( $flags, $text ) = $kid->_flatten($options); 847 872 $text = _TDtrim($text);
Note: See TracChangeset
for help on using the changeset viewer.
