My code looked fine in Ephox. I tried a few edit+saves and realised my mixed use of quotes was sometimes failing. I complained to the Ephox folks who quickly checked & assured me it was not their product causing the issue. So I went to Content Server and viewed the content item's XML. Sure enough I found the problem - my image references were rewritten as a new Idoc URL format that inserts its own single quotes.
Observe my original code...
<img src="/serverroot/somepath/contentID1.gif" onmouseover="this.src='/serverroot/somepath/contentID2.gif';" onmouseout="this.src='/serverroot/somepath/contentID1.gif';" />
Now see what XML (unencoded) is stored in my content item...
<img src="[!--$ssWeblayoutUrl('somepath/contentID1.gif')--]" onmouseover="this.src='[!--$ssWeblayoutUrl('somepath/contentID2.gif')--]';" onmouseout="this.src='[!--$ssWeblayoutUrl('somepath/contentID1.gif')--]';" />
Hey wow! My URLs are magically replaced with some new Idoc link format... that screws up my quote groups! Gee, thanks guys.
<img src="[!--$ssWeblayoutUrl('somepath/contentID1.gif')--]" onmouseover="this.src=''+'/serverroot/somepath/contentID2.gif';" onmouseout="this.src=''+'/serverroot/somepath/contentID1.gif';" />
Refer to metalink article 579457.1
I'm playing with the new format, here are my findings...
* apparently it is only used on img tags - not links. Bummer...
* it will redirect to the latest available revision - contributor mode links to revisions in workflow, non-contributor mode gives you the latest released instead. Nice!
here's how it looks:
<img src="[!--$ssWeblayoutUrl('contentID')--]" />
The bad news is that if the contentID is invalid or does not exist, it throws an error... more importantly, the editor will fail to load any content at all! Youch!
The good news is that the latest release of sitestudio(build298) is supposed to resolve the bug and also uses the new URL format on link tags.
Finally got authority to upgrade and yes, ssWebLayoutUrl is a total kickarse auto-replacement for image src URLs but no, it doesn't seem to replace other weblayout links automatically. Maybe I should update my validation script to do it...