This one should be "easy" (he says naively), but I really do need some sort of element or class that will be guaranteed to be either flattened or removed in transition from html2tml so I can make a tinymce work-around for Item9198.

Michael, added you in case you have some ideas (or such class/feature already exists and I just didn't see it!)

Currently, WysiwygPlugin's HTML2TML is very (overly!) vigorous at removing classes, and it flattens p, div and span tags without attributes, after removing classes (this is a huge over-simplification). I used this behaviour to my advantage in addressing Item1417, where I added a p tag with the foswikiDeleteMe class. There are unit tests to ensure that HTML2TML removes empty p tags with that class. The unit tests could be improved, but the existing test is some kind of guarantee that this behaviour will continue to work in the future. (Removing my name from WaitingFor)

I can protect HTML tags in the TML by applying a class to raw HTML tags found in the topic text. This means that HTML2TML would clean up HTML entered via TMCE and cut'n'paste from Word, but it would leave alone HTML that came from the topic text. That means that upgrading WysiwygPlugin would not provide "better cleanup" for topics with existing HTML. I think that is a fair trade-off.

I could limit this to a specific set of tags (e.g. div, span, table, td, th). I could use a preference (e.g. WYSIWYGPLUGIN_PRESERVE_EXISTING) to define the set of tags, defaulting to no tags if the preference is not set, and set the preference to div,span in DefaultPreferences.

Actually, that sounds very reasonable. I might say that WYSIWYGPLUGIN_PRESERVE_EXISTING_TAGS although more verbose, might be less like to conflict with some other _EXISTING feature later? I don't really mind either way

Yes, that name is better. I also think it would be more useful for upgraders if the default value for this preference was only in the plugin and not in DefaultPreferences.

I would like to revise the proposed mechanism as follows:

When converting from TML to HTML, WysiwygPlugin will mark tags that come from the TML with a specific class, so that it is possible to differentiate between tags that were originally in the TML and other tags of the same type that were inserted during editing or were produced by the TML2HTML conversion.

When converting from HTML to TML, WysiwygPlugin will not remove tags the listed in the WYSIWYGPLUGIN_PRESERVE_EXISTING_TAGS preference, that were originally in the TML.

That preference will not be given a value in DefaultPreferences.

The default value of that preference will be div, span.

HTML tags that were originally in the TML which are not listed in that preference, will not be given special treatment; they will be handled just like all other tags of the same type. For example, <table> tags might be converted to | table | markup, and spans might be flattened, depending on the attributes and the WYSIWYGPLUGIN_STICKYBITS setting.

The user may set the preference to blank (empty string) in which case no HTML tags originally in the TML will be given special treatment.

This fix went into 1.1, but it didn't make it into the 1.1 release notes because I still had to update the plugin release notes. That is now done. I have set the released-in version to 1.1.2 so that this goes into the 1.1.2 release notes.