Item2200: Inconsistencies in WysiwigPlugin Documentation and operation
Current State: Closed
Released In: 1.1.0
Target Release: minor
The documentation for the WYSIWYG plugin (or the implementation of the plugin) is inconsistent in several areas. I'm unsure whether the issues are in the documentation, or the plugin.
- WYSIWYGPLUGIN_ICONS is not documented.
- WYSIWYGPLUGIN_STICKYBITS default documentation doesn't match what's actually in the code. In addition, the
h\d regex to match heading tags doesn't work when passed through the setting.
h[0-9] alternate syntax works.
- In WysiwygPlugin#Translator_control section, the WYSIWYG_EXCLUDE settings are not used for TinyMCE plugin. The code checks to see if WYSIWYGSKIN is set. If it is not set, the code to process the EXCLUDE controls is bypassed.
- The WYSIWYG_STICKYBITS is not processed in the TML2HTML routines, so this setting doesn't actually protect the markup from the editor. There appear to be two cases:
- The editor (TinyMCE) preserves the tag. In this case, the STICKYBITS code works, and prevents the HTML2TML code from converting tags with unsupported attributes back to TML. Examples of working protection include "compact" lists.
- The editor (TinyMCE) corrupts or drops the tag. In this case, STICKYBITS code does not protect the tag, it is lost in the editor, and never seen by the HTML2TML code. Examples of lost markup include the <center> tag and <div align=center>. By default the latter should be protected by the default STICKBITS setting, but it is not.
Carefully reading the documentation, it does state that it applys only in the HTML2TML
conversion, but it is not totally clear how it works. Documentation needs some clarification.
It appears that STICKYBITS might need to be expanded with some additional settings.
- Externalize the TML2HTML "PALATABLE_TAGS" field. This is the list of tags that the editor supports. WYSIWIGPLUGIN_SUPPORTEDTAGS?
- It should be up to the editor plugin itself to register with WysiwygPlugin the tag + attribute combinations it supports (or does not support), perhaps with
_TUNE method to work we'd need to have
_TUNE as well.
- Calls to WysiwygPlugin
tml2html would need to be aware of which editor was making the call, so that it knows which set of
(UN)SUPPORTEDTAGS to apply (assuming support for multiple editors). -- PaulHarvey
- Add an "Exception" setting that will exclude tags based upon attributes. WYSIWIGPLUGIN_UNSUPPORTEDATTRIBUTES in the form of the current STICKYBITS.
- What about:
WYSIWYGPLUGIN_KEEPATTRIBUTES, which could be set via
strict: minimum (no?) HTML
normal: our current default
liberal: Enable editor features as much as possible. Probably, the
liberal policy should be defined by the editor.
all: don't strip any HTML which is supported by the editor.
- It would also be useful to enable add some extra policy modifiers, so you could Eg. have
normal,stricttable to make pasting from word/excel documents cleaner... -- PaulHarvey
So if a tag will be corrupted by the editor, it should either be deleted from PALATABLE_TAGS, or if corruption is sensitive to an attribute, added to the exception. If the tag is supported by the editor but will not survive the conversion back to TML, then it would be added to the STICKYBITS setting.
The differences are that STICKYBITS are transparent to the user. The markup is passed through the editor unmodified. Where as the new SUPPORTEDTAGS settings would result in visible protection of the markup similar to the <sticky> protection.
Continue discussion of STICKYBITS etc. over at Development.WysiwygContentPolicies
- 20 Nov 2009
The documentation changes have been made. Changing to Waiting for Release.
- 12 Aug 2010