Changeset 8123
- Timestamp:
- 07/11/10 16:47:51 (23 months ago)
- Location:
- trunk/WysiwygPlugin
- Files:
-
- 4 edited
-
lib/Foswiki/Plugins/WysiwygPlugin.pm (modified) (2 diffs)
-
lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm (modified) (11 diffs)
-
test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm (modified) (6 diffs)
-
test/unit/WysiwygPlugin/TranslatorTests.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin.pm
r8111 r8123 169 169 # Look for combinations of sticky and other markup that cause 170 170 # problems together 171 for my $tag ( 'literal' , keys %xmltag) {171 for my $tag ( 'literal' ) { 172 172 while ( $text =~ /<$tag\b[^>]*>(.*?)<\/$tag>/gsi ) { 173 173 my $inner = $1; … … 190 190 # Look for combinations of verbatim and other markup that cause 191 191 # problems together 192 for my $tag ( 'literal' , keys %xmltag) {192 for my $tag ( 'literal') { 193 193 while ( $text =~ /<$tag\b[^>]*>(.*?)<\/$tag>/gsi ) { 194 194 my $inner = $1; -
trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/TML2HTML.pm
r8111 r8123 129 129 $content = $this->_getRenderedVersion($content); 130 130 131 # Substitute back in protected elements 132 $content = $this->_dropBack($content); 133 134 if ( $content =~ /[$TT0$TT1$TT2]/o ) { 131 my $fail = ''; 132 $fail .= "TT0:[$1|TT0|$2]" if $content =~ /(.{0,10})[$TT0](.{0,10})/o; 133 $fail .= "TT1:[$1|TT1|$2]" if $content =~ /(.{0,10})[$TT1](.{0,10})/o; 134 $fail .= "TT2:[$1|TT2|$2]" if $content =~ /(.{0,10})[$TT2](.{0,10})/o; 135 if ($fail) { 135 136 136 137 # There should never be any of these in the text at this point. 137 138 # If there are, then the conversion failed. 138 die("Invalid characters in HTML after conversion ")139 die("Invalid characters in HTML after conversion: $fail") 139 140 if $options->{dieOnError}; 140 141 … … 157 158 158 159 sub _liftOut { 159 my ( $this, $text, $type, $encoding ) = @_; 160 $text = $this->_unLift($text); 160 my ( $this, $text, $type ) = @_; 161 my %options; 162 if ( $type and $type =~ /^(?:PROTECTED|STICKY|VERBATIM)$/ ) { 163 $options{protect} = 1; 164 } 165 $options{class} = 'WYSIWYG_' . $type; 166 return $this->_liftOutGeneral( $text, \%options ); 167 } 168 169 sub _liftOutGeneral { 170 my ( $this, $text, $options ) = @_; 171 172 #$text = $this->_unLift($text); 173 174 $options = {} unless ref($options); 175 161 176 my $n = scalar( @{ $this->{refs} } ); 162 177 push( 163 178 @{ $this->{refs} }, 164 179 { 165 type => $type, 166 encoding => $encoding || 'span', 167 text => $text 180 tag => $options->{tag} || 'span', 181 text => $text, 182 tmltag => $options->{tmltag}, 183 params => $options->{params}, 184 class => $options->{class}, 185 protect => $options->{protect}, 168 186 } 169 187 ); 188 170 189 return $TT1 . $n . $TT2; 171 190 } … … 181 200 182 201 sub _dropBack { 183 my ( $this, $text ) = @_;202 my ( $this, $text, $protecting ) = @_; 184 203 185 204 # Restore everything that was lifted out 186 while ( $text =~ s#$TT1([0-9]+)$TT2#$this->_dropIn($1 )#ge ) {205 while ( $text =~ s#$TT1([0-9]+)$TT2#$this->_dropIn($1, $protecting)#ge ) { 187 206 } 188 207 return $text; … … 190 209 191 210 sub _dropIn { 192 my ( $this, $n ) = @_;211 my ( $this, $n, $protecting ) = @_; 193 212 my $thing = $this->{refs}->[$n]; 194 return $thing->{text} if $thing->{encoding} eq 'NONE'; 195 my $method = 'CGI::' . $thing->{encoding}; 196 my $text = $thing->{text}; 213 214 my $text = $thing->{text}; 215 216 # Drop back recursively 217 $text = $this->_dropBack( $text, $protecting || $thing->{protect} ); 218 219 # Only protect at the outer-most level applicable 197 220 $text = _protectVerbatimChars($text) 198 if $thing->{type} =~ /^(PROTECTED|STICKY|VERBATIM)$/; 221 if $thing->{protect} and not $protecting; 222 223 if ($protecting) { 224 if ( $thing->{tmltag} ) { 225 return 226 "<$thing->{tmltag}$thing->{params}>$thing->{text}</$thing->{tmltag}>"; 227 } 228 else { 229 return $thing->{text}; 230 } 231 } 232 return $thing->{text} if $thing->{tag} eq 'NONE'; 233 234 my $method = 'CGI::' . $thing->{tag}; 235 236 $thing->{params} ||= {}; 237 $thing->{params} = _parseParams( $thing->{params} ) 238 if not ref $thing->{params}; 239 _addClass( $thing->{params}->{class}, $thing->{class} ) if $thing->{class}; 240 199 241 no strict 'refs'; 200 return &$method( { class => 'WYSIWYG_' . $thing->{type}}, $text );242 return &$method( $thing->{params}, $text ); 201 243 use strict 'refs'; 202 244 } … … 299 341 300 342 # Do sticky first; it can't be ignored 301 $text = $this->_takeOutBlocks( $text, 'sticky' ); 302 303 $text = $this->_takeOutBlocks( $text, 'verbatim' ); 304 305 $text = $this->_takeOutBlocks( $text, 'literal' ); 343 $text = $this->_liftOutBlocks( 344 $text, 'sticky', 345 { 346 tag => 'div', 347 protect => 1, 348 class => 'WYSIWYG_STICKY' 349 } 350 ); 351 352 $text = $this->_liftOutBlocks( 353 $text, 354 'verbatim', 355 { 356 tag => 'pre', 357 protect => 1, 358 class => 'TMLverbatim' 359 } 360 ); 361 362 $text = $this->_liftOutBlocks( 363 $text, 364 'literal', 365 { 366 tag => 'div', 367 class => 'WYSIWYG_LITERAL' 368 } 369 ); 306 370 307 371 $text = $this->_takeOutSets($text); … … 313 377 314 378 # Remove PRE to prevent TML interpretation of text inside it 315 $text = $this->_ takeOutBlocks( $text, 'pre');379 $text = $this->_liftOutBlocks( $text, 'pre', {} ); 316 380 317 381 # Protect comments … … 367 431 368 432 # other entities 433 # SMELL - international characters are not allowed in entity names 369 434 $text =~ s/&([$Foswiki::regex{mixedAlphaNum}]+;)/$TT0$1/g; # "&abc;" 370 435 $text =~ s/&(#[0-9]+;)/$TT0$1/g; # "{" … … 632 697 s/$WC::STARTWW(($Foswiki::regex{webNameRegex}\.)?$Foswiki::regex{wikiWordRegex}($Foswiki::regex{anchorRegex})?)/$this->_liftOut($1, 'LINK')/geom; 633 698 634 while ( my ( $placeholder, $val ) = each %{ $this->{removed} } ) {635 if ( $placeholder =~ /^verbatim/i ) {636 _addClass( $val->{params}->{class}, 'TMLverbatim' );637 }638 elsif ( $placeholder =~ /^literal/i ) {639 _addClass( $val->{params}->{class}, 'WYSIWYG_LITERAL' );640 }641 elsif ( $placeholder =~ /^sticky/i ) {642 _addClass( $val->{params}->{class}, 'WYSIWYG_STICKY' );643 }644 }645 646 $this->_putBackBlocks( $text, 'pre' );647 648 $this->_putBackBlocks( $text, 'literal', 'div' );649 650 # replace verbatim with pre in the final output, with encoded entities651 $this->_putBackBlocks( $text, 'verbatim', 'pre', \&_protectVerbatimChars );652 653 $this->_putBackBlocks( $text, 'sticky', 'div', \&_protectVerbatimChars );654 655 699 $text =~ s/(<nop>)/$this->_liftOut($1, 'PROTECTED')/ge; 700 701 # Substitute back in protected elements 702 $text = $this->_dropBack($text); 656 703 657 704 # Item1417: Insert a paragraph at the start of the document if the first tag … … 920 967 $text =~ s:([^/])>$:$1 />:; # close the tag XHTML style 921 968 922 return $this->_liftOut ( $text, '', 'NONE');969 return $this->_liftOutGeneral( $text, { tag => 'NONE' } ); 923 970 } 924 971 … … 989 1036 } 990 1037 991 sub _takeOutBlocks { 992 993 # my ( $this, $intext, $tag ) = @_; 994 995 sub _takeOutBlocksProcess { 1038 sub _liftOutBlocks { 1039 1040 my ( $this, $intext, $tag, $commonOptions ) = @_; 1041 1042 $commonOptions = {} unless ref($commonOptions); 1043 $commonOptions->{tag} ||= $tag; 1044 1045 my %allBlocksOptions = ( tmltag => $tag ); 1046 for my $option (qw/ tag class protect /) { 1047 $allBlocksOptions{$option} = $commonOptions->{$option} 1048 if $commonOptions->{$option}; 1049 } 1050 1051 my $liftOutBlocksProcess = sub { 996 1052 my ( $this, $state, $scoop ) = @_; 997 my $placeholder = $state->{tag} . $state->{n}; 998 $this->{removed}->{$placeholder} = {999 params => _parseParams( $state->{tagParams} ),1000 text => $scoop, 1001 };1002 return $ TT0 . $placeholder . $TT0;1003 } 1004 1005 return _takeOutXml( @_, \&_takeOutBlocksProcess );1053 1054 my %oneBlockOptions = %allBlocksOptions; 1055 $oneBlockOptions{params} = $state->{tagParams}; 1056 1057 my $params = $state->{tagParams}; 1058 return $this->_liftOutGeneral( $scoop, \%oneBlockOptions ); 1059 }; 1060 1061 return _takeOutXml( $this, $intext, $tag, $liftOutBlocksProcess ); 1006 1062 } 1007 1063 … … 1062 1118 1063 1119 return $out; 1064 }1065 1066 sub _putBackBlocks {1067 my ( $this, $text, $tag, $newtag, $callback ) = @_;1068 $newtag ||= $tag;1069 my $fn;1070 while ( my ( $placeholder, $val ) = each %{ $this->{removed} } ) {1071 if ( $placeholder =~ /^$tag\d+$/ ) {1072 my $params = $val->{params};1073 my $val = $val->{text};1074 $val = &$callback($val) if ( defined($callback) );1075 1076 # Use div instead of span if the block contains block HTML1077 if ( $newtag eq 'span' && $val =~ m#</?($WC::ALWAYS_BLOCK_S)\b#io )1078 {1079 $fn = 'CGI::div';1080 }1081 else {1082 $fn = 'CGI::' . $newtag;1083 }1084 no strict 'refs';1085 $_[1] =~ s/$TT0$placeholder$TT0/&$fn($params, $val)/e;1086 use strict 'refs';1087 delete( $this->{removed}->{$placeholder} );1088 }1089 }1090 1120 } 1091 1121 -
trunk/WysiwygPlugin/test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm
r8114 r8123 221 221 }, 222 222 { 223 exec => $CANNOTWYSIWYG, 224 225 # Do not perform ROUNDTRIP on this TML, because ROUNDTRIP passes. 226 # The problem with this TML is that the special handling of 227 # <verbatim> in the conversion to HTML messes up the contents 228 # of this custom XML tag, so that the HTML is not representative 229 # of the TML in terms of intellectual content. 223 exec => $TML2HTML | $ROUNDTRIP, 230 224 name => 'VerbatimInsideDot', 231 225 setup => sub { … … 245 239 </dot> 246 240 DOT 241 html => '<p>' 242 . $protecton 243 . '<dot><br />' 244 . 'digraph G {<br />' 245 . ' open [label="<verbatim>"];<br />' 246 . ' content [label="Put arbitrary content here"];<br />' 247 . ' close [label="</verbatim>"];<br />' 248 . ' open -> content -> close;<br />' 249 . '}<br />' 250 . '</dot>' 251 . $protectoff . '</p>', 247 252 }, 248 253 { … … 265 270 }, 266 271 { 267 exec => $ROUNDTRIP | $CANNOTWYSIWYG, #SMELL: fix this case272 exec => $TML2HTML | $ROUNDTRIP, 268 273 name => 'StickyInsideCustomtag', 269 274 setup => sub { … … 279 284 . '<customtag>' 280 285 . 'this ' 281 . ' <div class="WYSIWYG_STICKY">'286 . '<sticky>' 282 287 . '& that<br /> > the' 283 . ' </div>'288 . '</sticky>' 284 289 . ' other ' 285 290 . '</customtag>' … … 347 352 }, 348 353 { 349 exec => $ ROUNDTRIP | $CANNOTWYSIWYG, #SMELL: Fix this case350 name => ' LiteralInsideCustomtag',354 exec => $TML2HTML | $ROUNDTRIP, 355 name => 'insideCustomtag', 351 356 setup => sub { 352 357 $extraTML2HTMLOptions{xmltag} = … … 355 360 sub { 1 } ); 356 361 }, 357 tml => 358 '<customtag>this <literal>& that > the</literal> other </customtag>', 359 html => '<p>' 360 . '<div class="WYSIWYG_LITERAL">' 361 . '<customtag>this & that > the other </customtag>' 362 . '</div>' . '</p>' 362 tml => <<'HERE', 363 <customtag> 364 %MACRO{"<b>X</b>"}% 365 this <literal>& that > the</literal> other 366 <verbatim>V</verbatim> 367 <sticky>S</sticky> 368 <pre>P</pre> 369 <!--C--> 370 * Set foo=bar 371 http://google.com/#q=foswiki 372 WikiWord [[some link]] 373 <mytag attr="value">my content</mytag> 374 <img src="http://mysite.org/logo.png" alt="Alternate text" /> 375 </customtag> 376 HERE 377 html => '<p>' 378 . $protecton 379 . '<customtag><br />' 380 . '%MACRO{"<b>X</b>"}%<br />' 381 . 'this <literal>& that > the</literal> other<br />' 382 . '<verbatim>V</verbatim><br />' 383 . '<sticky>S</sticky><br />' 384 . '<pre>P</pre><br />' 385 . '<!--C--><br />' 386 . ' * Set foo=bar<br />' 387 . 'http://google.com/#q=foswiki<br />' 388 . 'WikiWord [[some link]]<br />' 389 . '<mytag attr="value">my content</mytag><br />' 390 . '<img src="http://mysite.org/logo.png" alt="Alternate text" /><br />' 391 . '</customtag>' 392 . $protectoff 393 . '</p>' 363 394 }, 364 395 { -
trunk/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm
r8113 r8123 1303 1303 </break> 1304 1304 * %FLIBBLE% 1305 * Set Other=stuff 1306 <sticky><font color="blue"> *|B|* </font></sticky> 1307 <!-- hidden --> 1308 http://google.com/#q=foswiki 1309 %FOO% WikiWord [[some link]] 1310 <img src="http://mysite.org/logo.png" alt="Alternate text" /> 1311 <verbatim class="tml">%H%<!--?--></verbatim> 1312 <literal><font color="blue"> *|B|* </font></literal> 1313 <mytag attr="value">my content</mytag> 1314 <sticky> block </sticky> 1315 <pre> 1316 123 1317 456 1318 </pre> 1305 1319 * Set FLEEGLE = easy gum 1306 1320 HERE 1307 html => '<ul> 1308 <li> Set FLIBBLE =<span class="WYSIWYG_PROTECTED"> <break> <cake/><br /> </break></span></li><li><span class="WYSIWYG_PROTECTED">%FLIBBLE%</span><ul><li>Set FLEEGLE =<span class="WYSIWYG_PROTECTED"> easy gum</span></li></ul></li></ul>', 1321 html => '<ul>'. 1322 '<li> Set FLIBBLE =<span class="WYSIWYG_PROTECTED"> <break> <cake/><br />'. 1323 ' </break></span></li>'. 1324 '<li><span class="WYSIWYG_PROTECTED">%FLIBBLE%</span></li>'. 1325 '<li> Set Other=<span class="WYSIWYG_PROTECTED">stuff<br />'. 1326 ' <sticky><font color="blue"> *|B|* </font></sticky><br />'. 1327 ' <!-- hidden --><br />'. 1328 ' http://google.com/#q=foswiki<br />'. 1329 ' %FOO% WikiWord [[some link]]<br />'. 1330 ' <img src="http://mysite.org/logo.png" alt="Alternate text" /><br />'. 1331 ' <verbatim class="tml">%H%<!--?--></verbatim><br />'. 1332 ' <literal><font color="blue"> *|B|* </font></literal><br />'. 1333 ' <mytag attr="value">my content</mytag><br />'. 1334 ' <sticky> block </sticky><br />'. 1335 ' <pre><br />'. 1336 ' 123<br />'. 1337 ' 456<br />'. 1338 ' </pre>'. 1339 '</span>'. 1340 '<ul><li>Set FLEEGLE =<span class="WYSIWYG_PROTECTED"> easy gum</span></li></ul></li></ul>', 1309 1341 }, 1310 1342 { … … 1971 2003 name => 'sticky', 1972 2004 tml => <<GLUED, 1973 <sticky><font color="blue"> *|B|* </font></sticky> 2005 <sticky><font color="blue"> *|B|* </font> 2006 2007 <!-- hidden --> 2008 http://google.com/#q=foswiki 2009 %FOO% WikiWord [[some link]] 2010 * Set bar=baz 2011 <img src="%!page!%/logo.png" alt="Alternate text" /> 2012 2013 <verbatim class="tml">%H%<!--?--></verbatim> 2014 <literal><font color="blue"> *|B|* </font></literal> 2015 <mytag attr="value">my content</mytag> 2016 2017 nested <sticky> block </sticky> 2018 2019 <pre> 2020 123 2021 456 2022 </pre></sticky> 1974 2023 GLUED 1975 html => '<p> 1976 <div class="WYSIWYG_STICKY"><font color="blue"> *|B|* </font></div> 1977 </p> 1978 ' 2024 html => '<p>'. 2025 '<div class="WYSIWYG_STICKY"><font color="blue"> *|B|* </font><br />'. 2026 '<br />'. 2027 '<!-- hidden --><br />'. 2028 'http://google.com/#q=foswiki<br />'. 2029 '%FOO% WikiWord [[some link]]<br />'. 2030 ' * Set bar=baz<br />'. 2031 '<img src="%!page!%/logo.png" alt="Alternate text" /><br />'. 2032 '<br />'. 2033 '<verbatim class="tml">%H%<!--?--></verbatim><br />'. 2034 '<literal><font color="blue"> *|B|* </font></literal><br />'. 2035 '<mytag attr="value">my content</mytag><br />'. 2036 '<br />'. 2037 'nested <sticky> block </sticky><br />'. 2038 '<br />'. 2039 '<pre><br />'. 2040 ' 123<br />'. 2041 ' 456<br />'. 2042 '</pre></div>'. 2043 '</p>' 2044 }, 2045 { 2046 exec => $TML2HTML | $ROUNDTRIP | $HTML2TML, 2047 name => 'verbatim', 2048 tml => <<GLUED, 2049 <verbatim><font color="blue"> *|B|* </font> 2050 2051 <!-- hidden --> 2052 http://google.com/#q=foswiki 2053 %FOO% WikiWord [[some link]] 2054 * Set bar=baz 2055 <img src="http://mysite.org/logo.png" alt="Alternate text" /> 2056 2057 nested <verbatim class="tml">%H%<!--?--></verbatim> 2058 <literal><font color="blue"> *|B|* </font></literal> 2059 <mytag attr="value">my content</mytag> 2060 2061 <sticky> block </sticky> 2062 2063 <pre> 2064 123 2065 456 2066 </pre></verbatim> 2067 GLUED 2068 html => '<p>'. 2069 '<pre class="TMLverbatim"><font color="blue"> *|B|* </font><br />'. 2070 '<br />'. 2071 '<!-- hidden --><br />'. 2072 'http://google.com/#q=foswiki<br />'. 2073 '%FOO% WikiWord [[some link]]<br />'. 2074 ' * Set bar=baz<br />'. 2075 '<img src="http://mysite.org/logo.png" alt="Alternate text" /><br />'. 2076 '<br />'. 2077 'nested <verbatim class="tml">%H%<!--?--></verbatim><br />'. 2078 '<literal><font color="blue"> *|B|* </font></literal><br />'. 2079 '<mytag attr="value">my content</mytag><br />'. 2080 '<br />'. 2081 '<sticky> block </sticky><br />'. 2082 '<br />'. 2083 '<pre><br />'. 2084 ' 123<br />'. 2085 ' 456<br />'. 2086 '</pre></pre>'. 2087 '</p>' 2088 }, 2089 { 2090 exec => $TML2HTML | $HTML2TML | $ROUNDTRIP, 2091 name => 'comment', 2092 tml => <<GLUED, 2093 <!--<font color="blue"> *|B|* </font> 2094 2095 http://google.com/#q=foswiki 2096 %FOO% WikiWord [[some link]] 2097 * Set bar=baz 2098 <img src="%!page!%/logo.png" alt="Alternate text" /> 2099 2100 <verbatim class="tml">%H%<!--?--></verbatim> 2101 <literal><font color="blue"> *|B|* </font></literal> 2102 <mytag attr="value">my content</mytag> 2103 2104 <sticky> block </sticky> 2105 2106 <pre> 2107 123 2108 456 2109 </pre>--> 2110 GLUED 2111 html => '<p>'.$protecton. 2112 '<!--<font color="blue"> *|B|* </font><br />'. 2113 '<br />'. 2114 'http://google.com/#q=foswiki<br />'. 2115 '%FOO% WikiWord [[some link]]<br />'. 2116 ' * Set bar=baz<br />'. 2117 '<img src="%!page!%/logo.png" alt="Alternate text" /><br />'. 2118 '<br />'. 2119 '<verbatim class="tml">%H%<!--?--></verbatim><br />'. 2120 '<literal><font color="blue"> *|B|* </font></literal><br />'. 2121 '<mytag attr="value">my content</mytag><br />'. 2122 '<br />'. 2123 '<sticky> block </sticky><br />'. 2124 '<br />'. 2125 '<pre><br />'. 2126 ' 123<br />'. 2127 ' 456<br />'. 2128 '</pre>-->'. 2129 $protectoff.'</p>', 2130 }, 2131 { 2132 # SMELL: The macro, the *Set value and the comment 2133 # should be in WYSIWYG_PROTECTED spans 2134 # but HTML2TML doesn't yet cater for that 2135 # So this test captures current (long-standing) behaviour, 2136 # but the behaviour isn't really correct 2137 exec => $TML2HTML | $HTML2TML | $ROUNDTRIP, 2138 name => 'literal', 2139 tml => <<'HERE', 2140 <literal> 2141 <font color="blue"> *|B|* </font> 2142 http://google.com/#q=foswiki WikiWord [[some link]] 2143 %FOO{"<b>html in macro param</b>"}% <!-- hidden --> 2144 <pre> 2145 123 2146 456 2147 </pre> 2148 * Set bar=baz 2149 <mytag attr="value">my content</mytag> 2150 </literal> 2151 HERE 2152 html => <<"HERE", 2153 <p> 2154 <div class="WYSIWYG_LITERAL"> 2155 <font color="blue"> *|B|* </font> 2156 http://google.com/#q=foswiki WikiWord [[some link]] 2157 %FOO{"<b>html in macro param</b>"}% <!-- hidden --> 2158 <pre> 2159 123 2160 456 2161 </pre> 2162 * Set bar=baz 2163 <mytag attr="value">my content</mytag> 2164 </div> 2165 </p> 2166 HERE 2167 finaltml => <<'HERE', 2168 <literal> 2169 <font color='blue'> *|B|* </font> 2170 http://google.com/#q=foswiki WikiWord [[some link]] 2171 %FOO{"<b>html in macro param</b>"}% <!-- hidden --> 2172 <pre> 2173 123 2174 456 2175 </pre> 2176 * Set bar=baz 2177 <mytag attr='value'>my content</mytag> 2178 </literal> 2179 HERE 1979 2180 }, 1980 2181 { … … 1998 2199 }, 1999 2200 { 2000 exec => $HTML2TML | $ROUNDTRIP,2001 name => 'stickyInsideVerbatimItem1980',2002 tml => <<'GLUED',2003 <verbatim><sticky>banana</sticky></verbatim>2004 GLUED2005 html => <<'BLAH',2006 <p>2007 <pre class="TMLverbatim"><sticky>banana</sticky></pre>2008 </p>2009 BLAH2010 },2011 {2012 exec => $ROUNDTRIP,2013 name => 'literalInsideVerbatimItem1980',2014 tml => <<'GLUED',2015 <verbatim><literal><font color="blue"> *|B|* </font></literal></verbatim>2016 GLUED2017 },2018 {2019 2201 exec => $ROUNDTRIP, 2020 2202 name => 'verbatimInsideLiteralItem1980', … … 2022 2204 <literal><font color="blue"> *|B|*<verbatim>%H%</verbatim> </font></literal> 2023 2205 GLUED 2024 },2025 {2026 exec => $TML2HTML | $ROUNDTRIP,2027 name => 'verbatimInsideStickyItem1980',2028 tml => <<'GLUED',2029 <sticky><font color="blue"> *|B|*<verbatim>%H%</verbatim> </font></sticky>2030 GLUED2031 html => <<'STUCK'2032 <p>2033 <div class="WYSIWYG_STICKY"><font color="blue"> *|B|*<verbatim>%H%</verbatim> </font></div>2034 </p>2035 STUCK2036 },2037 {2038 exec => $TML2HTML | $ROUNDTRIP,2039 name => 'literalInsideSticky',2040 tml => <<'GLUED',2041 <sticky><literal><font color="blue"> *|B|* </font></literal></sticky>2042 GLUED2043 html => <<'STUCK'2044 <p>2045 <div class="WYSIWYG_STICKY"><literal><font color="blue"> *|B|* </font></literal></div>2046 </p>2047 STUCK2048 2206 }, 2049 2207 { … … 2416 2574 { 2417 2575 name => "Item2222", 2418 exec => $ROUNDTRIP | $CANNOTWYSIWYG,2576 exec => $ROUNDTRIP, 2419 2577 tml => '<!-- <sticky></sticky> -->', 2420 2578 }, … … 2473 2631 <p><span class="WYSIWYG_PROTECTED">%JQPLUGINS{"scrollto"<br /> format="<br /> Homepage: $homepage <br /><br /> Author(s): $author <br /><br /> Version: $version<br /> "<br />}%</span></p> 2474 2632 HERE 2475 } 2633 }, 2634 { 2635 name => "stuffInMacro", 2636 exec => $TML2HTML | $ROUNDTRIP, 2637 tml => <<'HERE', 2638 %MACRO{" 2639 a%ANOTHER% 2640 <verbatim>V</verbatim> 2641 <sticky>S</sticky> 2642 <literal>L</literal> 2643 <pre>P</pre> 2644 <!--C--> 2645 * Set foo=bar 2646 http://google.com/#q=foswiki 2647 WikiWord [[some link]] 2648 <mytag attr="value">my content</mytag> 2649 <img src="http://mysite.org/logo.png" alt="Alternate text" /> 2650 "}% 2651 HERE 2652 html => '<p>' . 2653 '<span class="WYSIWYG_PROTECTED">'. 2654 '%MACRO{"<br />'. 2655 'a%ANOTHER%<br />'. 2656 '<verbatim>V</verbatim><br />'. 2657 '<sticky>S</sticky><br />'. 2658 '<literal>L</literal><br />'. 2659 '<pre>P</pre><br />'. 2660 '<!--C--><br />'. 2661 ' * Set foo=bar<br />'. 2662 'http://google.com/#q=foswiki<br />'. 2663 'WikiWord [[some link]]<br />'. 2664 '<mytag attr="value">my content</mytag><br />'. 2665 '<img src="http://mysite.org/logo.png" alt="Alternate text" /><br />'. 2666 '"}%'. 2667 '</span>'. 2668 '</p>' 2669 }, 2670 { 2671 name => "failsTML2HTML", 2672 exec => 0,#$TML2HTML | $HTML2TML | $ROUNDTRIP, 2673 tml => <<'HERE', 2674 %MACRO{" 2675 %ANOTHERMACRO%"}% 2676 HERE 2677 html => <<'HERE', 2678 <p><span class="WYSIWYG_PROTECTED">%MACRO{"<br />%ANOTHERMACRO%"}%</span></p> 2679 HERE 2680 }, 2476 2681 ]; 2477 2682
Note: See TracChangeset
for help on using the changeset viewer.
