Changeset 4051
- Timestamp:
- 06/06/09 20:21:19 (3 years ago)
- Location:
- trunk/WysiwygPlugin
- Files:
-
- 3 edited
-
data/System/WysiwygPlugin.txt (modified) (5 diffs)
-
data/System/WysiwygPluginSettings.txt (modified) (1 diff)
-
lib/Foswiki/Plugins/WysiwygPlugin.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WysiwygPlugin/data/System/WysiwygPlugin.txt
r3416 r4051 25 25 26 26 ---+++ 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. .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. 28 28 29 29 The 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. … … 33 33 Translation 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. 34 34 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.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. 36 36 37 37 ---+++ Using the translators from Perl scripts … … 90 90 TML2HTML translator to prepare the text, which is then returned 91 91 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. 93 93 1 After edit handling is as for _Generating content directly in a specialised edit template_ 94 94 … … 136 136 137 137 Plugins 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. 138 140 139 141 ---+++ Overlapping styles … … 166 168 | Plugin Version: | %$VERSION% | 167 169 | 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 <sticky> tags (Michael Tempest) Foswikitask:Item1674: Let plugins register XML tags that should be protected like macros | 168 171 | 10 Apr 2009 | Foswikitask:Item1394: fixed colour handling | 169 172 | 03 Dec 2008 | Foswikitask:Item6041: fixed empty bullet list problem. Foswiki version | -
trunk/WysiwygPlugin/data/System/WysiwygPluginSettings.txt
r1073 r4051 15 15 You can define the global preference =WYSIWYGPLUGIN_STICKYBITS= to stop the 16 16 plugin from ever trying to convert specific HTML tags into 17 HTML when certain specific attributes are present on the tag. This is most17 TML when certain specific attributes are present on the tag. This is most 18 18 useful when you have styling or alignment information in tags that must be 19 19 preserved. -
trunk/WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin.pm
r3992 r4051 551 551 =pod 552 552 553 ---++ ObjectMethodaddXMLTag($tag, \&fn)553 ---++ Function addXMLTag($tag, \&fn) 554 554 555 555 Instruct WysiwygPlugin to "lift out" the named tag
Note: See TracChangeset
for help on using the changeset viewer.
