I have a problem pasting copied HTML into the editor. To reproduce,
1. goto a site (e.g. google.com)
2. CTRL+A to copy the page (not source but from the browser)
3. Either save the page
Now the error is that the page will not have saved what you pasted in, instead it will save what was there before you pasted. Also, if you click the "source" button on the editor toolbar, you will also notice that there is no source, it's blank.
Is this a known issue (I couldn't find it in the bug list)? Are there any work arounds?
thanks,
Horst
1. goto a site (e.g. google.com)
2. CTRL+A to copy the page (not source but from the browser)
3. Either save the page
Now the error is that the page will not have saved what you pasted in, instead it will save what was there before you pasted. Also, if you click the "source" button on the editor toolbar, you will also notice that there is no source, it's blank.
Is this a known issue (I couldn't find it in the bug list)? Are there any work arounds?
thanks,
Horst
RE: Pasting HTML in IE
<label for=all> the web</label>
and
<label for=cty>pages from Canada</label>
I've corrected (or rather glossed over) this problem in my FCK sources by modifying the function FCKXHtml._AppendAttribute in _source/internals/fckxhtml.js to look like,
FCKXHtml._AppendAttribute = function( xmlNode, attributeName, attributeValue )
{
// There is a bug in Mozilla that returns '_moz_dirty' as specified.
if ( FCKBrowserInfo.IsGecko && attributeName.indexOf( '_moz' ) == 0 )
return ;
// Create the attribute.
var oXmlAtt = this.XML.createAttribute( attributeName ) ;
// I added
if ( attributeValue == null ) {
//alert('attributeValue is null for attributeName: ' + attributeName);
// NOTE: not handling error, just avoiding
return;
}
// XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
if ( attributeValue === true )
oXmlAtt.value = attributeName ;
else
oXmlAtt.value = attributeValue ;
// Set the attribute in the node.
xmlNode.attributes.setNamedItem( oXmlAtt ) ;
}
So this allows you to paste and save the Google home page. However, errors will still be displayed because of the javascript within the google page. You can modify you FCKeditor to remove all SCRIPT tags in pasted content by changing the case statement for "script" in FCKXHtml._AppendNode function in fckxhtml.js
// "SCRIPT" and "STYLE" must be a CDATA.
case "script" :
// dont include any SCRIPT elements
return iAddedNodes;
Note that I'm not sure what side effects this may have! But it seems to work all right for me so far.
-Horst