Changeset 10487
- Timestamp:
- 01/06/11 12:46:15 (17 months ago)
- Location:
- branches/Release01x01/WysiwygPlugin
- Files:
-
- 8 edited
-
data/System/WysiwygPlugin.txt (modified) (2 diffs)
-
lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm (modified) (1 diff)
-
lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm (modified) (3 diffs)
-
lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm (modified) (5 diffs)
-
test/unit/WysiwygPlugin/BrowserEditorInterface.pm (modified) (2 diffs)
-
test/unit/WysiwygPlugin/BrowserTranslatorTests.pm (modified) (4 diffs)
-
test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm (modified) (2 diffs)
-
test/unit/WysiwygPlugin/TranslatorTests.pm (modified) (37 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x01/WysiwygPlugin/data/System/WysiwygPlugin.txt
r10486 r10487 163 163 ---+++ TinyMCEPlugin integration 164 164 %STARTSECTION{"tinymceintegration"}% 165 * Foswikitask:Item2174 - WysiwygPlugin removes line breaks 166 * Work-around: Use the =* Set NOWYSIWYG = 1= setting to disable WYSIWYG on line-sensitive topics 165 167 * Foswikitask:Item1396 - Anchors are not handled by WysiwygPlugin 166 168 * Foswikitask:Item5955 - WysiwygPlugin fails to roundtrip tables with align="center", border attributes, etc. … … 188 190 | Release: | %$RELEASE% | 189 191 | Change History: | | 190 | 26 Nov 2010 | Foswikitask:Item2174: Protect line breaks within paragraphs in TML <br/> \ 191 Foswikitask:Item10048: Try to use Macros in the src URLs of images with titles <br/> \ 192 | 26 Nov 2010 | Foswikitask:Item10048: Try to use Macros in the src URLs of images with titles <br/> \ 192 193 Foswikitask:Item9973: Fix attachments REST handler to deal with topics named with international characters | 193 194 | 04 Oct 2010 | Foswikitask:Item1391: Protect div and span tags with =style= attributes | -
branches/Release01x01/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm
r10485 r10487 16 16 our $ALWAYS_BLOCK_S = join( '|', keys %ALWAYS_BLOCK ); 17 17 18 our $STARTWW = qr/^|(?<=[ \t\n\(\!]) |(?<=<p>)|(?<= <\/span>)/om;19 our $ENDWW = qr/$|(?=[ \t\n\,\.\;\:\!\?\)]) |(?=<\/p>)|(?=<span\b[^>]*> )/om;18 our $STARTWW = qr/^|(?<=[ \t\n\(\!])/om; 19 our $ENDWW = qr/$|(?=[ \t\n\,\.\;\:\!\?\)])/om; 20 20 our $PROTOCOL = qr/^(file|ftp|gopher|https?|irc|news|nntp|telnet|mailto):/; 21 21 -
branches/Release01x01/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
r10486 r10487 38 38 39 39 my %tml2htmlClass = map { $_ => 1 } 40 qw( WYSIWYG_PROTECTED WYSIWYG_STICKY TMLverbatim WYSIWYG_LINK41 TMLhtml WYSIWYG_HIDDENWHITESPACE);40 qw( WYSIWYG_PROTECTED WYSIWYG_STICKY TMLverbatim WYSIWYG_LINK 41 TMLhtml ); 42 42 43 43 =pod … … 1518 1518 my ( $f, $kids ) = $this->_flatten($options); 1519 1519 return ( $f, '<hr />' . $kids ) if ( $options & $WC::NO_BLOCK_TML ); 1520 1521 my $dashes = 3; 1522 if ( $this->{attrs}->{style} 1523 and $this->{attrs}->{style} =~ s/\bnumdashes\s*:\s*(\d+)\b// ) 1524 { 1525 $dashes = $1; 1526 $dashes = 3 if $dashes < 3; 1527 $dashes = 160 if $dashes > 160; # Filter out probably-bad data 1528 } 1529 return ( $f | $WC::BLOCK_TML, 1530 $WC::CHECKn . ( '-' x $dashes ) . $WC::CHECKn . $kids ); 1520 return ( $f | $WC::BLOCK_TML, $WC::CHECKn . '---' . $WC::CHECKn . $kids ); 1531 1521 } 1532 1522 … … 1693 1683 } 1694 1684 1695 if ( _removeClass( \%atts, 'WYSIWYG_HIDDENWHITESPACE' ) ) {1696 1697 # This regular expression ensures the encoded whitespace is valid.1698 # The limit on the number of digits will ensure that the numbers are reasonable.1699 if ( $atts{style}1700 and $atts{style} =~1701 s/\bencoded\s*:\s*(['"])((?:b|n|t\d{1,2}|s\d{1,3})+)\1;?// )1702 {1703 my $whitespace = $2;1704 1705 #print STDERR "'$whitespace' -> ";1706 $whitespace =~ s/b/\\/g;1707 $whitespace =~ s/n/$WC::NBBR/g;1708 $whitespace =~ s/t(\d+)/'\t' x $1/ge;1709 $whitespace =~ s/s(\d+)/$WC::NBSP x $1/ge;1710 1711 #print STDERR "'$whitespace'\n";1712 #require Data::Dumper;1713 my ( $f, $kids ) =1714 $this->_flatten( $options | $WC::KEEP_WS | $WC::KEEP_ENTITIES );1715 1716 #die Data::Dumper::Dumper($kids);1717 if ( $kids eq ' ' ) {1718 1719 # The space was not changed1720 # So restore the encoded whitespace1721 return ( $f, $whitespace );1722 }1723 elsif ( length($kids) == 0 ) {1724 1725 # The user deleted the space1726 # So return blank1727 return ( 0, '' );1728 }1729 1730 #else {die "'".ord($kids)."'";}if(1){}1731 elsif ( 01732 and1733 ( $kids eq ' ' or $kids eq ' ' or $kids eq chr(160) )1734 )1735 { # SMELL: Firefox-specific1736 # This was probably inserted by Firefox after the user deleted the space.1737 # So return blank1738 return ( 0, '' );1739 }1740 else {1741 1742 # The user entered some new text1743 # Return the combination.1744 # Assume that a leading space corresponds to the encoded whitespace1745 $kids =~ s/^ //;1746 return ( $f, $whitespace . $kids );1747 }1748 }1749 }1750 1751 1685 # Remove all other (non foswiki) classes 1752 1686 if ( defined $atts{class} && $atts{class} !~ /foswiki/ ) { -
branches/Release01x01/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
r10486 r10487 381 381 $text = $this->_takeOutCustomTags($text); 382 382 383 $text =~ s/\\\n/ /g; 383 384 $text =~ s/\t/ /g; 384 $text =~ s/( +\\\n)/$this->_hideWhitespace($1)/ge;385 385 386 386 # Remove PRE to prevent TML interpretation of text inside it … … 450 450 451 451 # Horizontal rule 452 $text =~ s/^(---+)$/_encodeHr($1)/gme; 452 my $hr = CGI::hr( { class => 'TMLhr' } ); 453 $text =~ s/^---+$/$hr/gm; 453 454 454 455 # Wrap tables with macros before or after them in a <div>, … … 627 628 628 629 } 629 elsif ($inList 630 && $line =~ s/^([ \t]+)/$this->_hideWhitespace("\n$1")/e ) 631 { 630 elsif ( $inList && $line =~ /^[ \t]/ ) { 632 631 633 632 # Extend text of previous list item by dropping through 634 $result[-1] .= $line; 635 $line = ''; 636 637 } 638 elsif ( $line =~ /^<hr class="TMLhr"/ ) { 633 634 } 635 elsif ( $line eq $hr ) { 639 636 push( @result, '</p>' ) if $inParagraph; 640 637 $inParagraph = 0; … … 661 658 $this->_addListItem( \@result, '', '', '' ) if $inList; 662 659 $inList = 0; 663 if ( $inParagraph and @result and $result[-1] !~ /<p>$/ ) {664 665 # This is the second (or later) line of a paragraph666 667 my $whitespace = "\n";668 if ( $line =~ s/^(\s+)// ) {669 $whitespace .= $1;670 }671 $line = $this->_hideWhitespace($whitespace) . $line;672 }673 660 unless ( $inParagraph or $inDiv ) { 674 661 push( @result, '<p>' ); 675 662 $inParagraph = 1; 676 663 } 677 $line =~ s/(\s\s+)/$this->_hideWhitespace($1)/ge; 678 $result[-1] .= $line; 679 $line = ''; 680 } 681 682 push( @result, $line ) if length($line) > 0; 664 } 665 666 push( @result, $line ); 683 667 } 684 668 … … 739 723 740 724 return $text; 741 }742 743 sub _encodeHr {744 my $dashes = shift;745 my $style = '';746 if ( length($dashes) > 3 ) {747 $style = ' style="{numdashes:' . length($dashes) . '}"';748 }749 return '<hr class="TMLhr"' . $style . ' />';750 }751 752 sub _hideWhitespace {753 my $this = shift;754 my $whitespace = shift;755 756 $whitespace =~ s/\\/b/g;757 $whitespace =~ s/\n/n/g;758 $whitespace =~ s/(\t+)/'t' . length($1)/ge;759 $whitespace =~ s/( +)/'s' . length($1)/ge;760 761 return $this->_liftOutGeneral(762 " ",763 {764 tag => 'span',765 class => "WYSIWYG_HIDDENWHITESPACE",766 params => "style=\"{encoded:'$whitespace'}\"",767 }768 );769 725 } 770 726 -
branches/Release01x01/WysiwygPlugin/test/unit/WysiwygPlugin/BrowserEditorInterface.pm
r10485 r10487 11 11 sub _DEBUG {0}; 12 12 13 my $editFrameLocator = "css=iframe#topic_ifr"; 14 my $wikitextLocator = "css=a#topic_hide"; 15 my $wysiwygLocator = "css=input#topic_2WYSIWYG"; 16 my $editTextareaLocator = "css=textarea#topic"; 17 my $editCancelButtonLocator = "css=input#cancel"; 18 my $editSaveButtonLocator = "css=input#save"; 19 my $editSaveContinueButtonLocator = "css=input#checkpoint"; 13 my $editFrameLocator = "css=iframe#topic_ifr"; 14 my $wikitextLocator = "css=a#topic_hide"; 15 my $wysiwygLocator = "css=input#topic_2WYSIWYG"; 16 my $editTextareaLocator = "css=textarea#topic"; 17 my $editCancelButtonLocator = "css=input#cancel"; 18 my $editSaveButtonLocator = "css=input#save"; 20 19 21 20 # This must match the text in foswiki_tiny.js … … 183 182 } 184 183 185 sub saveAndContinue {186 my $this = shift;187 print STDERR "BrowserEditorInterface::saveAndContinue()\n" if _DEBUG;188 189 $this->{_test}->assert(0, "editor not open")190 unless exists $this->{_editorModeForBrowser}191 ->{ $this->{_test}->browserName() };192 193 $this->selectTopFrame();194 $this->{_test}->selenium->click_ok($editSaveContinueButtonLocator);195 196 # The editor can take a while to open, and has to do another server request to convert TML2HTML, so use a longer timeout197 $this->{_test}->selenium->wait_for_element_present( $editFrameLocator,198 2 * $this->{_test}->timeout() );199 $this->{_test}->selenium->pause()200 ; # Breathe for a moment; let TMCE settle before doing anything else201 202 }203 204 184 sub selectWysiwygEditorFrame { 205 185 my $this = shift; -
branches/Release01x01/WysiwygPlugin/test/unit/WysiwygPlugin/BrowserTranslatorTests.pm
r10485 r10487 477 477 $this->{editor}->init(); 478 478 479 # Close the editor because this test uses a different topic479 # Close the editor because this tests uses a different topic 480 480 if ( $this->{editor}->editorMode() ) { 481 481 $this->{editor}->cancelEdit(); … … 502 502 "Before${testText}After\n"); 503 503 $topicObject->save(); 504 $topicObject->finish();505 506 # Reload the topic and note the topic date507 $topicObject = Foswiki::Meta->new(508 $this->{session},509 $this->{test_web},510 $topicName);511 $topicObject->load();512 my $topicinfo = $topicObject->get( 'TOPICINFO' );513 my $dateBeforeSaveFromEditor = $topicinfo->{date};514 $this->assert($dateBeforeSaveFromEditor, "Date from topic info before saving from editor");515 $topicObject->finish();516 504 517 505 # Open the test topic in the wysiwyg editor … … 519 507 ->openWysiwygEditor( $this->{test_web}, $topicName ); 520 508 521 # Make sure the topic timestamp is different, 522 # so that we can confirm that the save did write to the file 523 sleep(1); 509 # Write rubbish over the topic, which will be overwritten on save 510 $topicObject->text("Rubbish"); 511 $topicObject->save(); 512 undef $topicObject; 524 513 525 514 # Save from the editor … … 531 520 $this->{test_web}, 532 521 $topicName); 533 $topicObject->load();534 535 # Make sure the topic really was saved536 $topicinfo = $topicObject->get( 'TOPICINFO' );537 my $dateAfterSaveFromEditor = $topicinfo->{date};538 $this->assert($dateAfterSaveFromEditor, "Date from topic info after saving from editor");539 $this->assert_num_not_equals($dateBeforeSaveFromEditor, $dateAfterSaveFromEditor);540 522 541 523 my $text = $topicObject->text(); -
branches/Release01x01/WysiwygPlugin/test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm
r10485 r10487 101 101 . '<customtag>' 102 102 . $protectoff 103 . 'some >' 104 . TranslatorTests::encodedWhitespace('s2') 105 . 'text' 103 . 'some > text' 106 104 . $protecton 107 105 . '</customtag>' 108 106 . $protectoff . '</p>', 109 107 tml => '<customtag>some > text</customtag>', 110 finaltml => '<customtag>some > text</customtag>',108 finaltml => '<customtag>some > text</customtag>', 111 109 }, 112 110 { … … 123 121 . '<customtag>' 124 122 . $protectoff 125 . 'some >' 126 . TranslatorTests::encodedWhitespace('s2') 127 . 'text' 123 . 'some > text' 128 124 . $protecton 129 125 . '</customtag>' 130 126 . $protectoff . '</p>', 131 127 tml => '<customtag>some > text</customtag>', 132 finaltml => '<customtag>some > text</customtag>',128 finaltml => '<customtag>some > text</customtag>', 133 129 }, 134 130 { -
branches/Release01x01/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm
r10486 r10487 94 94 </p> 95 95 HERE 96 finaltml => <<'HERE', 97 Move !ItTest/site/ToWeb5 leaving web5 as !MySQL host 98 HERE 96 99 }, 97 100 { … … 108 111 }, 109 112 { 110 exec => $ROUNDTRIP, 111 name => 'currentWebLinkAtStart', 112 tml => 'Current.LinkAtStart', 113 html => $linkon . 'Current.LinkAtStart' . $linkoff, 113 exec => $ROUNDTRIP, 114 name => 'currentWebLinkAtStart', 115 tml => 'Current.LinkAtStart', 116 html => $linkon . 'Current.LinkAtStart' . $linkoff, 117 finaltml => 'Current.LinkAtStart', 114 118 }, 115 119 { … … 147 151 <b>reminded about${linkon}http://www.koders.com${linkoff}</b> 148 152 HERE 149 tml => '*reminded about http://www.koders.com*', 153 tml => '*reminded about http://www.koders.com*', 154 finaltml => '*reminded about http://www.koders.com*', 150 155 }, 151 156 { … … 414 419 exec => $ROUNDTRIP | $TML2HTML, 415 420 name => 'simpleHR', 416 html => 417 '<hr class="TMLhr"/><hr class="TMLhr" style="{numdashes:7}"/><p>--</p>', 418 tml => <<'HERE', 421 html => '<hr class="TMLhr"/><hr class="TMLhr"/><p>--</p>', 422 tml => <<'HERE', 419 423 --- 420 424 ------- … … 424 428 finaltml => <<'HERE', 425 429 --- 426 --- ----430 --- 427 431 428 432 -- … … 780 784 }, 781 785 { 782 exec => $ HTML2TML,783 name => 'squabsWithVars 1',786 exec => $ROUNDTRIP, 787 name => 'squabsWithVars', 784 788 html => <<HERE, 785 ${linkon}[[wiki syntax]]$linkoff$linkon\[[%MAINWEB%.Wiki users]]${linkoff} 786 escaped: 787 [${nop}[wiki syntax]] 788 HERE 789 tml => <<'EVERYWHERE', 790 [[wiki syntax]][[%MAINWEB%.Wiki users]] escaped: [<nop>[wiki syntax]] 791 EVERYWHERE 792 }, 793 { 794 exec => $ROUNDTRIP, 795 name => 'squabsWithVars2', 796 html => <<HERE, 797 ${linkon}[[wiki syntax]]$linkoff$linkon\[[%MAINWEB%.Wiki users]]${linkoff} 789 ${linkon}[[wiki syntax]]$linkoff$linkon\[[%MAINWEB%.TWiki users]]${linkoff} 798 790 escaped: 799 791 [<nop>[wiki syntax]] 800 792 HERE 801 793 tml => <<'THERE', 802 [[wiki syntax]][[%MAINWEB%. Wiki users]]794 [[wiki syntax]][[%MAINWEB%.TWiki users]] 803 795 escaped: 804 796 ![[wiki syntax]] 805 797 THERE 798 finaltml => <<'EVERYWHERE', 799 [[wiki syntax]][[%MAINWEB%.TWiki users]] escaped: ![[wiki syntax]] 800 EVERYWHERE 806 801 }, 807 802 { … … 827 822 }, 828 823 { 829 exec => $ROUNDTRIP, 830 name => 'plingedVarOne', 831 html => '!<span class="WYSIWYG_PROTECTED">%MAINWEB%</span>nowt', 832 tml => '!%MAINWEB%nowt', 833 }, 834 { 835 exec => $ROUNDTRIP, 836 name => 'plingedVarTwo', 837 html => 'nowt!<span class="WYSIWYG_PROTECTED">%MAINWEB%</span>', 838 tml => 'nowt!%MAINWEB%', 824 exec => $ROUNDTRIP, 825 name => 'plingedVarOne', 826 html => '!<span class="WYSIWYG_PROTECTED">%MAINWEB%</span>nowt', 827 tml => '!%MAINWEB%nowt', 828 finaltml => '!%MAINWEB%nowt', 829 }, 830 { 831 exec => $ROUNDTRIP, 832 name => 'plingedVarTwo', 833 html => 'nowt!<span class="WYSIWYG_PROTECTED">%MAINWEB%</span>', 834 tml => 'nowt!%MAINWEB%', 835 finaltml => 'nowt!%MAINWEB%', 839 836 }, 840 837 { … … 1010 1007 }, 1011 1008 { 1012 exec => $HTML2TML, 1013 name => 'nestedVerbatim1', 1014 html => 'Outside 1015 <span class="TMLverbatim"><br /> Inside<br /> </span> Outside', 1016 tml => 'Outside <verbatim> 1017 Inside 1018 </verbatim> Outside', 1019 }, 1020 { 1021 exec => $ROUNDTRIP, 1022 name => 'nestedVerbatim2', 1009 exec => $ROUNDTRIP, 1010 name => 'nestedVerbatim', 1023 1011 html => 'Outside 1024 1012 <span class="TMLverbatim"><br />Inside<br /></span>Outside', … … 1028 1016 </verbatim> 1029 1017 Outside', 1018 finaltml => 'Outside <verbatim> 1019 Inside 1020 </verbatim> Outside', 1030 1021 }, 1031 1022 { … … 1087 1078 Outside 1088 1079 ', 1089 finaltml => 'Outside 1090 <verbatim> 1080 finaltml => 'Outside <verbatim> 1091 1081 Inside 1092 </verbatim> 1093 Outside', 1094 }, 1095 { 1096 exec => $ROUNDTRIP, 1097 name => 'nestedIndentedPre1', 1082 </verbatim> Outside', 1083 }, 1084 { 1085 exec => $ROUNDTRIP | $HTML2TML, 1086 name => 'nestedIndentedPre', 1098 1087 html => 'Outside 1099 1088 <pre> … … 1110 1099 </pre> 1111 1100 Outside', 1112 }, 1113 { 1114 exec => $HTML2TML, 1115 name => 'nestedIndentedPre2', 1116 html => 'Outside 1117 <pre> 1118 Inside 1119 1120 Snide 1121 </pre> 1122 Outside', 1123 tml => 'Outside <pre> 1101 finaltml => 'Outside <pre> 1124 1102 Inside 1125 1103 … … 1140 1118 }, 1141 1119 { 1142 exec => $HTML2TML, 1143 name => 'indentedPre1', 1144 html => 'Outside<pre> 1145 Inside 1146 </pre> Outside', 1147 tml => 'Outside<pre> 1148 Inside 1149 </pre> Outside', 1150 }, 1151 { 1152 exec => $ROUNDTRIP, 1153 name => 'indentedPre2', 1120 exec => $ROUNDTRIP, 1121 name => 'indentedPre', 1154 1122 html => 'Outside<pre> 1155 1123 Inside … … 1160 1128 </pre> 1161 1129 Outside', 1162 }, 1163 { 1164 exec => $TML2HTML | $ROUNDTRIP, 1165 name => 'NAL1', 1130 finaltml => 'Outside <pre> 1131 Inside 1132 </pre> Outside', 1133 }, 1134 { 1135 exec => $TML2HTML | $ROUNDTRIP, 1136 name => 'NAL', 1166 1137 html => '<p>Outside 1167 1138 <span class="WYSIWYG_PROTECTED"><noautolink></span> … … 1169 1140 <span class="WYSIWYG_PROTECTED"></noautolink></span> 1170 1141 Outside</p>', 1171 tml => 'Outside <noautolink> Inside </noautolink> Outside',1172 },1173 {1174 exec => $TML2HTML | $ROUNDTRIP,1175 name => 'NAL2',1176 html => '<p>Outside'1177 . encodedWhitespace('ns1')1178 . '<span class="WYSIWYG_PROTECTED"><noautolink></span>'1179 . encodedWhitespace('ns1')1180 . 'Inside'1181 . encodedWhitespace('ns1')1182 . '<span class="WYSIWYG_PROTECTED"></noautolink></span>'1183 . encodedWhitespace('ns1')1184 . 'Outside</p>',1185 1142 tml => 'Outside 1186 1143 <noautolink> … … 1188 1145 </noautolink> 1189 1146 Outside', 1190 }, 1191 { 1192 exec => $HTML2TML, 1193 name => 'classifiedNAL1', 1147 finaltml => 'Outside <noautolink> Inside </noautolink> Outside', 1148 }, 1149 { 1150 exec => $TML2HTML | $ROUNDTRIP, 1151 name => 'classifiedNAL', 1194 1152 html => '<p>Outside 1195 1153 <span class="WYSIWYG_PROTECTED"><noautolink class="foswikiAlert"></span></p> … … 1200 1158 Outside 1201 1159 </p>', 1202 tml => 'Outside <noautolink class="foswikiAlert">1203 * Inside1204 </noautolink> Outside',1205 },1206 {1207 exec => $TML2HTML | $ROUNDTRIP,1208 name => 'classifiedNAL2',1209 html => '<p>Outside'1210 . encodedWhitespace('n')1211 . '<span class="WYSIWYG_PROTECTED"><noautolink class="foswikiAlert"></span></p>1212 <ul>1213 <li> Inside </li>1214 </ul>1215 <p><span class="WYSIWYG_PROTECTED"></noautolink></span>'1216 . encodedWhitespace('ns1') . 'Outside1217 </p>',1218 1160 tml => 'Outside 1219 1161 <noautolink class="foswikiAlert"> … … 1221 1163 </noautolink> 1222 1164 Outside', 1223 }, 1224 { 1225 exec => $HTML2TML, 1226 name => 'indentedNAL1', 1165 finaltml => 'Outside <noautolink class="foswikiAlert"> 1166 * Inside 1167 </noautolink> Outside', 1168 }, 1169 { 1170 exec => $ROUNDTRIP, 1171 name => 'indentedNAL', 1227 1172 html => 'Outside 1228 1173 <span class="WYSIWYG_PROTECTED"><noautolink></span> … … 1231 1176 Outside 1232 1177 ', 1233 tml => 'Outside <noautolink> Inside </noautolink> Outside', 1234 }, 1235 { 1236 exec => $ROUNDTRIP, 1237 name => 'indentedNAL2', 1238 tml => 'Outside 1178 tml => 'Outside 1239 1179 <noautolink> 1240 1180 Inside … … 1242 1182 Outside 1243 1183 ', 1244 finaltml => 'Outside 1245 <noautolink> 1246 Inside 1247 </noautolink> 1248 Outside', 1184 finaltml => 'Outside <noautolink> Inside </noautolink> Outside', 1249 1185 }, 1250 1186 { … … 1256 1192 }, 1257 1193 { 1258 exec => $HTML2TML,1259 name => 'inlineBreaks',1260 html => 'Zadoc<br />The<br />Priest',1261 tml=> 'Zadoc<br />The<br />Priest',1194 exec => $HTML2TML, 1195 name => 'inlineBreaks', 1196 html => 'Zadoc<br />The<br />Priest', 1197 finaltml => 'Zadoc<br />The<br />Priest', 1262 1198 }, 1263 1199 { … … 1304 1240 { 1305 1241 exec => $ROUNDTRIP, 1306 name => " WikiTagsInHTMLParam",1242 name => "TWikiTagsInHTMLParam", 1307 1243 html => "${linkon}[[%!page!%/Burble/Barf][Burble]]${linkoff}", 1308 1244 tml => '[[%!page!%/Burble/Barf][Burble]]', … … 1501 1437 ${linkon}\[[Sandbox.TestTopic]]${linkoff} 1502 1438 HERE 1439 finaltml => <<HERE, 1440 Current.TestTopic Sandbox.TestTopic [[Current.TestTopic]] [[Sandbox.TestTopic]] 1441 HERE 1503 1442 }, 1504 1443 { … … 1515 1454 html => 1516 1455 "${linkon}[[WebCTPasswords][Resetting a WebCT Password]]${linkoff}", 1456 finaltml => '[[WebCTPasswords][Resetting a WebCT Password]]', 1517 1457 }, 1518 1458 { … … 1551 1491 </li><li></li><li>y 1552 1492 </li></ul>', 1553 finaltml => << "HERE",1493 finaltml => <<'HERE', 1554 1494 * x 1555 * $trailingSpace1495 * 1556 1496 * y 1557 1497 HERE … … 1590 1530 }, 1591 1531 { 1592 exec => $HTML2TML | $ROUNDTRIP,1532 exec => $HTML2TML, # | $ROUNDTRIP, 1593 1533 name => 'Item4435', 1594 1534 html => <<HTML, … … 1631 1571 exec => $TML2HTML | $HTML2TML | $ROUNDTRIP, 1632 1572 html => '<p> 1633 Paraone '1634 . encodedWhitespace('n') . 'Paratwo1573 Paraone 1574 Paratwo 1635 1575 </p> 1636 1576 <p> … … 1648 1588 1649 1589 Parafour', 1650 finaltml => 'Paraone 1651 Paratwo 1590 finaltml => 'Paraone Paratwo 1652 1591 1653 1592 Parathree … … 1795 1734 <p><span class="WYSIWYG_PROTECTED"><section></span></p> 1796 1735 <h2 class="TML"> B </h2> 1797 <p>C' 1798 . encodedWhitespace('n') 1799 . '<span class="WYSIWYG_PROTECTED"></section></span>' 1800 . encodedWhitespace('n') . 'X</p> 1736 <p>C 1737 <span class="WYSIWYG_PROTECTED"></section></span> 1738 X</p> 1801 1739 ', 1802 1740 finaltml => <<FGFG, … … 1806 1744 ---++ B 1807 1745 1808 C 1809 </section> 1810 X 1746 C </section> X 1811 1747 FGFG 1812 1748 }, … … 1830 1766 F <i> <b>here</b></i>F 1831 1767 XWYZ 1768 final_tml => <<ZYX, 1769 ZYX 1832 1770 }, 1833 1771 { … … 2375 2313 No more 2376 2314 SPACED 2377 html => '<ol> 2378 <li> One item' 2379 . encodedWhitespace('ns5') . 'spanning several lines 2380 2381 </li> <li> And another item' 2382 . encodedWhitespace('ns1') . 'with one space 2315 html => <<DECAPS, 2316 <ol> 2317 <li> One item spanning several lines 2318 2319 </li> <li> And another item with one space 2383 2320 </li></ol> 2384 2321 <p>No more</p> 2385 ', 2322 DECAPS 2386 2323 }, 2387 2324 { … … 2456 2393 Blah 2457 2394 BLAH 2458 html => '<p>2459 Blah' 2460 . encodedWhitespace('n') 2461 . '<span class="WYSIWYG_PROTECTED"><a href="%SCRIPTURLPATH{"edit"}%/%WEB%/%TOPIC%?t=%GM%NOP%TIME{"$epoch"}%"></span>edit<span2462 class="WYSIWYG_PROTECTED"></a></span> '2463 . encodedWhitespace('n') . 'Blah2464 </p> 2465 ', 2395 html => <<'BLAH', 2396 <p> 2397 Blah 2398 <span class="WYSIWYG_PROTECTED"><a href="%SCRIPTURLPATH{"edit"}%/%WEB%/%TOPIC%?t=%GM%NOP%TIME{"$epoch"}%"></span>edit<span 2399 class="WYSIWYG_PROTECTED"></a></span> 2400 Blah 2401 </p> 2402 BLAH 2466 2403 }, 2467 2404 { … … 2616 2553 &><" 2617 2554 HERE 2618 html => '<p> 2619 <span class="WYSIWYG_PROTECTED"><smeg></span>' 2620 . encodedWhitespace('n') 2621 . '<pre class="TMLverbatim"><br /><img src="ball&co<ck>s">&><"<br /></pre>' 2622 . encodedWhitespace('n') 2623 . '&><" 2624 </p> 2625 ', 2555 html => <<HERE, 2556 <p> 2557 <span class="WYSIWYG_PROTECTED"><smeg></span> 2558 <pre class="TMLverbatim"><br /><img src="ball&co<ck>s">&><"<br /></pre> 2559 &><" 2560 </p> 2561 HERE 2562 finaltml => <<HERE, 2563 <smeg> <verbatim> 2564 <img src="ball&co<ck>s">&><" 2565 </verbatim> &><" 2566 HERE 2626 2567 }, 2627 2568 { … … 2629 2570 exec => $TML2HTML | $ROUNDTRIP, 2630 2571 tml => <<HERE, 2572 <pre> 2573 hello 2574 there 2575 </pre> 2576 HERE 2577 finaltml => <<HERE, 2631 2578 <pre> 2632 2579 hello … … 2655 2602 name => "Item5961", 2656 2603 exec => $HTML2TML | $ROUNDTRIP, 2604 html => 'o<strong>n</strong>e', 2657 2605 html => 2658 2606 ' <strong>zero</strong> <strong>on</strong>e t<strong>w</strong>o t<strong>re</strong>', … … 2684 2632 exec => $TML2HTML | $ROUNDTRIP, 2685 2633 tml => <<'HERE', 2634 --- 2635 2636 %SEARCH{search="Sven"}% 2637 HERE 2638 finaltml => <<'HERE', 2686 2639 --- 2687 2640 … … 2764 2717 . '"}%' 2765 2718 . '</span>' . '</p>' 2766 },2767 {2768 name => "whitespaceEncoding",2769 exec => $TML2HTML | $ROUNDTRIP,2770 tml => <<'HERE',2771 a a2772 b2773 * c2774 d2775 e2776 HERE2777 html => '<p>' . 'a'2778 . encodedWhitespace('s2') . 'a'2779 . encodedWhitespace('ns1') . 'b' . '</p>'2780 . '<ul><li>' . 'c'2781 . encodedWhitespace('ns5') . 'd'2782 . '</li></ul>' . '<p>' . 'e' . '</p>',2783 2719 }, 2784 2720 {
Note: See TracChangeset
for help on using the changeset viewer.
