Rauan Maemirov wrote:
Quote:
I tried to do it myself, but all I did is to replaced
>
<object width="425" height="355"><param name="movie" value="URL"></
param><param name="wmode" value="transparent"></param><embed src="URL"
type="application/x-shockwave-flash" wmode="transparent" width="425"
height="355"></embed></object>
>
with
>
<object width="425" height="355"><param name="movie" value="URL"></
param><param name="wmode" value="transparent"></param><img src="URL"
type="application/x-shockwave-flash" wmode="transparent" width="425"
height="355"></embed></object>
1. My tests indicate that a Flash movie is not played by an `img' element,
so replacing the object-embed element combination would be futile, even
though the `embed' element is proprietary (and therefore not Valid).
2. Using client-side scripting to correct markup is the wrong approach
as it does not need to be available.
3. If necessary, you should rewrite the editor instead.
4. FWIW, in Eclipse I would have used the following parameters:
Search for:
(?s)<object\s+.*?<embed\s+.*?(src=".+?")[^>]*?\s+(width=.+?>)</embed></object>
Replace with:
<img $1 $2 alt="">
(Don't forget the `alt' attribute, give it a descriptive value if
possible/applicable!)
BTW, QuickREx again came in handy in finding that out:
<http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html>
5. With the exception of `(?s)', which can be worked around with
`(?:.|[\r\n])' instead of `.', this should also work with
String.prototype.replace() in JavaScript 1.5+ (Mozilla/5.0),
JScript 5.5+ (IE 5.5+), ECMAScript Ed. 3+.
6. Replacing content this way might require using `innerHTML', a
proprietary property that should be avoided in favor of DOM 2 scripting.
HTH
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee