![]() ![]() there will be HTML features that can be entered by editors that will be lost in this translation step. Due to the simple nature of TML and the potential complexity of web pages, this translation is often lossy - i.e. There is also the advantage that the translator can be used to import HTML from other sources - for example, existing web pages. CPAN:HTML::Parser is better at handling malformed HTML. A strict parser would risk losing content. This parser is used in preference to a more modern XML parser, because the WYSIWYG editor may not generate fully compliant XHTML. Translation of the HTML back to TML uses the CPAN:HTML::Parser. In fact, the translator is taken almost directly from the implementation of the rendering pipeline for the TWiki-4 release The generated XHTML is annotated with CSS classes that support the accurate recovery of the original TML.īefore you ask the obvious question, yes, the translator could be used to replace the Foswiki rendering pipeline for generating HTML pages. To solve this problem the plugin instead uses its own translation of TML to XHTML. 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. 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. On save, the edited HTML is run through the reverse translation before saving to the topic. The HTML is then fed to the WYSIWYG editor. The plugin works by translating the topic text into HTML when someone edits a topic. Generic plugin for automating the translation during editing. ![]() HTML to TML translator (with stand-alone script).The package includes the following pieces: Incompatible with "non-standard" syntax.WYSIWYGPLUGIN_IGNOREATTRS - Ignore tag attributes when deciding whether to keep a tag or not when converting HTML to TML.WYSIWYGPLUGIN_STICKYBITS - Protect tags based upon their arguments.WYSIWYGPLUGIN_PROTECT_TAG_BLOCKS - Protect specific tag blocks originally in the topic text.WYSIWYGPLUGIN_PROTECT_EXISTING_TAGS - Protect specific tags originally in the topic text.WYSIWYG_EDITABLE_CALLS - Exceptions to WYSIWYG_EXCLUDE.WYSIWYG_EXCLUDE - Prevent WYSIWYG editing.Generating content directly in a specialised edit template.Generating content directly in the standard edit template.Using the translators from Perl scripts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |