Ignore:
Timestamp:
06/24/09 21:13:57 (3 years ago)
Author:
MichaelTempest
Message:

Item1770: Update documentation; add more unit tests

File:
1 edited

Legend:

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

    r4144 r4295  
    551551=pod 
    552552 
    553 ---++ Function addXMLTag($tag, \&fn) 
     553---++ StaticMethod addXMLTag($tag, \&fn) 
    554554 
    555555Instruct WysiwygPlugin to "lift out" the named tag  
    556556and pass it to &fn for processing. 
    557557&fn may modify the text of the tag. 
    558 &fn should return 0 is the tag is to be re-embedded immediately, 
     558&fn should return 0 if the tag is to be re-embedded immediately, 
    559559or 1 if it is to be re-embedded after all processing is complete. 
    560560The text passed (by reference) to &fn includes the  
    561561=<tag> ... </tag>= brackets. 
     562 
     563The simplest use of this function is something like this: 
     564=Foswiki::Plugins::WysiwygPlugin::addXMLTag( 'mytag', sub { 1 } );= 
    562565 
    563566A plugin may call this function more than once  
     
    565568However, only the *original plugin* may change the processing 
    566569for a tag. 
     570 
     571Plugins should call this function from their =initPlugin= 
     572handlers so that WysiwygPlugin will protect the XML-like tags 
     573for all conversions, including REST conversions. 
     574Plugins that are intended to be used with older versions of Foswiki 
     575(e.g. 1.0.6) should check that this function is defined before calling it, 
     576so that they degrade gracefully if an older version of WysiwygPlugin 
     577(e.g. that shipped with 1.0.6) is installed. 
    567578 
    568579=cut 
Note: See TracChangeset for help on using the changeset viewer.