internal package
Foswiki::Plugins::WysiwygPlugin::HTML2TML internal package
Foswiki::Plugins::WysiwygPlugin::HTML2TML; Convertor for translating HTML into TML (Topic Meta Language)
The conversion is done by parsing the HTML and generating a parse tree, and then converting that parse tree into TML.
The class is a subclass of HTML::Parser, run in XML mode, so it should be tolerant to many syntax errors, and will also handle XHTML syntax.
The translator tries hard to make good use of newlines in the HTML, in order to maintain text level formating that isn't reflected in the HTML. So the parser retains newlines and spaces, rather than throwing them away, and uses various heuristics to determine which to keep when generating the final TML.
ClassMethod
new() Constructs a new HTML to TML convertor.
You must provide parseWikiUrl and convertImage if you want URLs translated back to wikinames. See WysiwygPlugin.pm for an example of how to call it.ObjectMethod
convert( $html, \%options ) → $tml Convert a block of HTML text into TML.
Options: