Changeset 6203


Ignore:
Timestamp:
02/02/10 01:59:04 (2 years ago)
Author:
SvenDowideit
Message:

Item8454: TML2HTML's WYSIWYG_PROTECTED span's contain a spurious br element caused by undocumented use of an optional \n in the %-splitting Crawford, Paul and anyone else, please have a look and see if you can work out/remember why..

Location:
trunk/WysiwygPlugin
Files:
3 edited

Legend:

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

    r5573 r6203  
    189189    return '' unless defined($text); 
    190190 
    191     my @queue = split( /(\n?%)/s, $text ); 
     191#SMELL: why put a \n into the split? (at least document it..) 
     192#    my @queue = split( /(\n?%)/s, $text ); 
     193#SVEN: I've removed the extra \n capture, and am seeing what the tests tell me.. 
     194#      doing so removes an (so far) unexplaind <br /> that was put into the WYSIWYG_PROTECTED bloc.. 
     195#      eg. <span class="WYSIWYG_PROTECTED"><br />%TABLESEP%</span> 
     196#SMELL: having removed the \n from the split, the code below now _should_ be rewritten to remove the  
     197#      other processing of the \n. For now (Feb2010), I've left it as is, so that we can revert to the old  
     198#      code if/when someone figures out why it was in the split in the first place. 
     199    my @queue = split( /(%)/s, $text ); 
    192200    my @stack; 
    193201    my $stackTop = ''; 
  • trunk/WysiwygPlugin/test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm

    r6133 r6203  
    652652<tr><td><span class="WYSIWYG_LINK">[[LegacyTopic1]]</span></td><td><span class="WYSIWYG_LINK">Main.SomeGuy</span></td></tr> 
    653653</table> 
    654 <span class="WYSIWYG_PROTECTED"><br />%TABLESEP%</span> 
    655 <span class="WYSIWYG_PROTECTED"><br />%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
     654<span class="WYSIWYG_PROTECTED">%TABLESEP%</span> 
     655<span class="WYSIWYG_PROTECTED">%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
    656656THERE 
    657657    }, 
     
    669669<tr><td><span class="WYSIWYG_LINK">[[LegacyTopic1]]</span></td><td><span class="WYSIWYG_LINK">Main.SomeGuy</span></td></tr> 
    670670</table> 
    671 <span class="WYSIWYG_PROTECTED"><br />%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
     671<span class="WYSIWYG_PROTECTED">%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
    672672THERE 
    673673    }, 
  • trunk/WysiwygPlugin/test/unit/WysiwygPlugin/TranslatorTests.pm

    r6132 r6203  
    667667        name => 'variousWikiWords', 
    668668        html => 
    669 "<p>${linkon}WebPreferences${linkoff}</p><p>$protecton<br />%MAINWEB%$protectoff.WikiUsers</p><p>${linkon}CompleteAndUtterNothing${linkoff}</p><p>${linkon}LinkBox$linkoff${linkon}LinkBoxs${linkoff}${linkon}LinkBoxies${linkoff}${linkon}LinkBoxess${linkoff}${linkon}LinkBoxesses${linkoff}${linkon}LinkBoxes${linkoff}</p>", 
     669"<p>${linkon}WebPreferences${linkoff}</p><p>$protecton%MAINWEB%$protectoff.WikiUsers</p><p>${linkon}CompleteAndUtterNothing${linkoff}</p><p>${linkon}LinkBox$linkoff${linkon}LinkBoxs${linkoff}${linkon}LinkBoxies${linkoff}${linkon}LinkBoxess${linkoff}${linkon}LinkBoxesses${linkoff}${linkon}LinkBoxes${linkoff}</p>", 
    670670        tml => <<'YYY', 
    671671WebPreferences 
     
    19811981<tr><td><span class="WYSIWYG_LINK">[[LegacyTopic1]]</span></td><td><span class="WYSIWYG_LINK">Main.SomeGuy</span></td></tr> 
    19821982</table> 
    1983 <span class="WYSIWYG_PROTECTED"><br />%TABLESEP%</span> 
    1984 <span class="WYSIWYG_PROTECTED"><br />%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
     1983<span class="WYSIWYG_PROTECTED">%TABLESEP%</span> 
     1984<span class="WYSIWYG_PROTECTED">%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
    19851985THERE 
    19861986    }, 
     
    19961996<tr><td><span class="WYSIWYG_LINK">[[LegacyTopic1]]</span></td><td><span class="WYSIWYG_LINK">Main.SomeGuy</span></td></tr> 
    19971997</table> 
    1998 <span class="WYSIWYG_PROTECTED"><br />%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
     1998<span class="WYSIWYG_PROTECTED">%SEARCH{"legacy" nonoise="on" format="| [[\$topic]] | [[\$wikiname]] |"}%</span> 
    19991999THERE 
    20002000    }, 
     
    22332233        exec => $ROUNDTRIP | $CANNOTWYSIWYG, 
    22342234        tml  => '<!-- <sticky></sticky> -->', 
     2235    }, 
     2236    { 
     2237        name => "ItemSVEN", 
     2238        exec => $TML2HTML | $ROUNDTRIP, 
     2239        tml  => <<'HERE', 
     2240--- 
     2241 
     2242%SEARCH{search="Sven"}% 
     2243HERE 
     2244        finaltml => <<'HERE', 
     2245--- 
     2246 
     2247%SEARCH{search="Sven"}% 
     2248HERE 
     2249        html => <<'HERE', 
     2250<p> 
     2251<hr class="TMLhr" /> 
     2252</p> 
     2253<p> 
     2254<span class="WYSIWYG_PROTECTED">%SEARCH{search=&#34;Sven&#34;}%</span> 
     2255</p> 
     2256HERE 
    22352257    }, 
    22362258]; 
Note: See TracChangeset for help on using the changeset viewer.