Re: Tip: full XHTML validation.
In most browsers, external Javascript files are cached unless the user stomps on their default browser cache settings. If your editor is loading often during a session or your CMS users use the CMS a lot, placing the init code in an external .js file should go close to negating the extra 15 Kb of download time in practical terms. It's not ideal, but it's not bad.
With regards to replacing tags such as <u> with style definitions, is there something wrong with a bit of code called on the save event that does the following?
<pseudo>
for each node in the DOM
if the node tag name is <u> then
set the selection to outer HTML
grab the inner HTML from the selection
remove the parent tag from the selection using DOM commands
if the parent tag isn't a <span>
expand the inner HTML with <span style="text-decoration: underline;">inner HTML</span>
else
add the "text-decoration: underline;" attribute using DOM commands
end if
replace the selection
end if
next
</pseudo>This could quite easily be expanded to handle any tag and any replacement code from a config file...
I'm new to Tiny MCE so I don't know how the edit/cleanup/save procedure works yet. Also my DOM experience comes mostly from the evil world of IE proprietary code, so I'm not sure if some of the nice built-in DOM manipulation commands are supported in other browsers. So pardon my ignorance if it is ignorance.
These are just some thoughts that came to mind after reading this thread.
-- Rob.