Changeset 3984
- Timestamp:
- 05/27/09 19:14:48 (3 years ago)
- Location:
- trunk/WysiwygPlugin
- Files:
-
- 2 edited
-
lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm (modified) (4 diffs)
-
test/unit/WysiwygPlugin/TranslatorTests.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
r3947 r3984 455 455 { 456 456 457 my %new_attrs = ( class => $class ); 458 $new_attrs{style} = $this->{attrs}->{style} 459 if exists $this->{attrs}->{style}; 457 460 my $newspan = 458 461 new Foswiki::Plugins::WysiwygPlugin::HTML2TML::Node( $this->{context}, 459 'span', { class => $class });462 'span', \%new_attrs ); 460 463 my $kid = $this->{head}; 461 464 while ($kid) { … … 512 515 513 516 $this->_moveClassToSpan('WYSIWYG_TT'); 517 $this->_moveClassToSpan('WYSIWYG_COLOR') 518 if lc( $this->{tag} ) ne 'font'; 514 519 515 520 # See if we have a TML translation function for this tag … … 865 870 if ( $kid->{tag} eq 'th' ) { 866 871 $kid->_moveClassToSpan('WYSIWYG_TT'); 872 $kid->_moveClassToSpan('WYSIWYG_COLOR'); 867 873 ( $flags, $text ) = $kid->_flatten($options); 868 874 $text = _TDtrim($text); … … 871 877 elsif ( $kid->{tag} eq 'td' ) { 872 878 $kid->_moveClassToSpan('WYSIWYG_TT'); 879 $kid->_moveClassToSpan('WYSIWYG_COLOR'); 873 880 ( $flags, $text ) = $kid->_flatten($options); 874 881 $text = _TDtrim($text); -
trunk/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm
r3947 r3984 223 223 BLAH 224 224 tml => '==Code==' 225 }, 226 { 227 exec => $HTML2TML | $ROUNDTRIP, 228 name => 'strongWithTtAndColorClasses', 229 html => <<'BLAH', 230 <p> 231 <strong class="WYSIWYG_TT WYSIWYG_COLOR" style="color:#FF0000;">Code</strong> 232 </p> 233 BLAH 234 tml => '*%RED% =Code= %ENDCOLOR%*' 225 235 }, 226 236 { … … 422 432 }, 423 433 { 434 exec => $TML2HTML | $ROUNDTRIP, 435 name => 'orderedList_Item1341', 436 html => <<'HERE', 437 <ol><li>Sushi</li><li>Banana</li></ol><p /> 438 <ol><li type="A">Sushi</li><li type="A">Banana</li></ol><p /> 439 <ol><li type="i">Sushi</li><li type="i">Banana</li></ol><p /> 440 <ol><li type="I">Sushi</li><li type="I">Banana</li></ol><p /> 441 <ol><li>Sushi</li><li type="A">Sushi</li><li type="i">Sushi</li></ol> 442 HERE 443 tml => <<'HERE', 444 1 Sushi 445 1 Banana 446 447 A. Sushi 448 A. Banana 449 450 i. Sushi 451 i. Banana 452 453 I. Sushi 454 I. Banana 455 456 1 Sushi 457 A. Sushi 458 i. Sushi 459 HERE 460 }, 461 { 424 462 exec => $ROUNDTRIP, 425 463 name => 'mixedList', … … 838 876 </verbatim> Outside', 839 877 }, 878 { 879 exec => $TML2HTML | $ROUNDTRIP, 880 name => 'verbatimWithNbsp1554', 881 html => '<p><pre class="TMLverbatim">&nbsp;</pre></p>', 882 tml => "<verbatim> </verbatim>" 883 }, 840 884 { 841 885 exec => $TML2HTML | $ROUNDTRIP, … … 1673 1717 html => 'the <tt><tt>co</tt>mple<code>te</code></tt> table', 1674 1718 tml => 'the =complete= table', 1719 }, 1720 { 1721 exec => $HTML2TML, 1722 name => 'strongWithColorClass', 1723 html => <<'BLAH', 1724 <p> 1725 <strong class="WYSIWYG_COLOR" style="color:#FF0000;">Strong red</strong> 1726 </p> 1727 BLAH 1728 tml => '*%RED%Strong red%ENDCOLOR%*' 1729 }, 1730 { 1731 exec => $HTML2TML | $ROUNDTRIP, 1732 name => 'colorClassInTable', 1733 html => <<'BLAH', 1734 <table> 1735 <tr><th class="WYSIWYG_COLOR" style="color:#FF0000;">Red Heading</th></tr> 1736 <tr><td class="WYSIWYG_COLOR" style="color:#FF0000;">Red herring</td></tr> 1737 </table> 1738 BLAH 1739 tml => <<'BLAH', 1740 | *%RED%Red Heading%ENDCOLOR%* | 1741 | %RED%Red herring%ENDCOLOR% | 1742 BLAH 1743 }, 1744 { 1745 exec => $HTML2TML | $ROUNDTRIP, 1746 name => 'colorAndTtClassInTable', 1747 html => <<'BLAH', 1748 <table> 1749 <tr><th class="WYSIWYG_COLOR WYSIWYG_TT" style="color:#FF0000;">Redder code</th></tr> 1750 <tr><td class="WYSIWYG_COLOR WYSIWYG_TT" style="color:#FF0000;">Red code</td></tr> 1751 </table> 1752 BLAH 1753 tml => <<'BLAH', 1754 | *%RED% =Redder code= %ENDCOLOR%* | 1755 | %RED% =Red code= %ENDCOLOR% | 1756 BLAH 1675 1757 }, 1676 1758 {
Note: See TracChangeset
for help on using the changeset viewer.
