Changeset 4051


Ignore:
Timestamp:
06/06/09 20:21:19 (3 years ago)
Author:
MichaelTempest
Message:

Item1674: Documentation update

Location:
trunk/WysiwygPlugin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WysiwygPlugin/data/System/WysiwygPlugin.txt

    r3416 r4051  
    2525 
    2626---+++ How it works 
    27 The plugin works by translating the topic text into HTML when someone edits a topic. The HTML is then fed to the WYSIWYG editor. On save, the edited HTML is run through the reverse translation before saving to the topic. TML is used in preference to HTML in the stored topic wherever possible, though HTML may be used if the translator can't find a suitable TML equivalent.. 
     27The plugin works by translating the topic text into HTML when someone edits a topic. The HTML is then fed to the WYSIWYG editor. On save, the edited HTML is run through the reverse translation before saving to the topic. TML is used in preference to HTML in the stored topic wherever possible, though HTML may be used if the translator can't find a suitable TML equivalent. 
    2828 
    2929The default rendering that Foswiki uses to generate HTML for display in browsers is 'lossy' - information in the TML is lost in the HTML output, and a round-trip (recovering the original TML from the HTML) is impossible. To solve this problem the plugin instead uses its own translation of TML to XHTML. The generated XHTML is annotated with CSS classes that support the accurate recovery of the original TML. 
     
    3333Translation of the HTML back to TML uses the CPAN:HTML::Parser. This parser is used in preference to a more modern XML parser, because the WYSIWYG editor may not generate fully compliant XHTML. A strict parser would risk losing content. CPAN:HTML::Parser is better at handling malformed HTML. 
    3434 
    35 There is also the advantage that the translator can be used to *import* HTML from other sources - for example, existing web pages. Due to the simple nature of TML and the potential complexity of web pages, this translation is often lossy - i.e there will be HTML features that can be entered by editors that will be lost in this translation step. This is especially noticeable with HTML tables. 
     35There is also the advantage that the translator can be used to *import* HTML from other sources - for example, existing web pages. Due to the simple nature of TML and the potential complexity of web pages, this translation is often lossy - i.e. there will be HTML features that can be entered by editors that will be lost in this translation step. This is especially noticeable with HTML tables. 
    3636 
    3737---+++ Using the translators from Perl scripts 
     
    9090        TML2HTML translator to prepare the text, which is then returned 
    9191        as =text/plain= to the browser. 
    92       * Two macros, =%<nop>OWEB%= and %<nop>OTOPIC%=, can be used in the content URL in the edit template to refer to the source topic for the content. 
     92      * Two macros, =%<nop>OWEB%= and =%<nop>OTOPIC%=, can be used in the content URL in the edit template to refer to the source topic for the content. 
    9393   1 After edit handling is as for _Generating content directly in a specialised edit template_ 
    9494 
     
    136136 
    137137Plugins that extend the syntax using macros, such as =%MYMACRO%=, should work fine. 
     138 
     139*Implementors note* plugins that use XML-like tags may call Foswiki::Plugins::WysiwygPlugin::addXMLTag() to make WysiwygPlugin protect the content between XML-like tags, just like it does for macros.  
    138140 
    139141---+++ Overlapping styles 
     
    166168|  Plugin Version: | %$VERSION% | 
    167169|  Change History: | | 
     170|  6 Jun 2009 | Foswikitask:Item1013: Correct dependency on HTML::Parser (Will Norris) Foswikitask:Item1397: Foswikitask:Item1535: Fosikitask:Item1666: Correct processing of colour and typewriter-text in several situations, include application to bold text and table cells (Michael Tempest) Foswikitask:Item1667: Remove unwanted extra &lt;sticky&gt; tags (Michael Tempest) Foswikitask:Item1674: Let plugins register XML tags that should be protected like macros | 
    168171|  10 Apr 2009 | Foswikitask:Item1394: fixed colour handling | 
    169172|  03 Dec 2008 | Foswikitask:Item6041: fixed empty bullet list problem. Foswiki version | 
  • trunk/WysiwygPlugin/data/System/WysiwygPluginSettings.txt

    r1073 r4051  
    1515You can define the global preference =WYSIWYGPLUGIN_STICKYBITS= to stop the 
    1616plugin from ever trying to convert specific HTML tags into 
    17 HTML when certain specific attributes are present on the tag. This is most 
     17TML when certain specific attributes are present on the tag. This is most 
    1818useful when you have styling or alignment information in tags that must be 
    1919preserved. 
  • trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin.pm

    r3992 r4051  
    551551=pod 
    552552 
    553 ---++ ObjectMethod addXMLTag($tag, \&fn) 
     553---++ Function addXMLTag($tag, \&fn) 
    554554 
    555555Instruct WysiwygPlugin to "lift out" the named tag  
Note: See TracChangeset for help on using the changeset viewer.