Hello there!
I'm working on a CMS, and we have tags like this in it:
<r:link page="3">Page three</r:link>
These tags doesn't show up in the editor, so I figured I might do something like what FCKeditor does with anchors and hidden input-fields.
This is my plugin code:
var FCKInternalTagProcessor = FCKDocumentProcessor.AppendNew() ; FCKInternalTagProcessor.ProcessDocument = function( document ) { var aLINKs = document.getElementsByTagName('R:LINK') ; alert(aLINKs.length); var eLINK ; var i = aLINKs.length - 1 ; while ( i >= 0 && ( eLINK = aLINKs[i--] ) ) { var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__InternalLink', eLINK.cloneNode(true) ) ; eLINK.parentNode.insertBefore( oFakeImage, eLINK ) ; eLINK.parentNode.removeChild( eLINK ) ; } }
Most of the code is copied straight from the FCKeditor source, I only changed some variable names.
Anyways.
alert(aLINKs.length); always says there are 0 R:LINK-tags, even though there are more than 0. If I change all tags to R instead (<r page="3"></r>), and change the line in my plugin to document.getElementsByTagName('R');, it finds the tags, and the rest works too.
This got me thinking that getElementsByTagName can't find <r:whatever>-tags, so I tried it (http://nekasrof.ath.cx/~andreas/foobar.html), and it works!
Why does it work there, and not in FCKeditor?
Any ideas?
Thanks in advance
Re: getElementsByTagName, CreateFakeImage
Oopsidaisy!

It was all my fault!
A long time ago, I added this in fckconfig.js:
FCKConfig.ProtectedSource.Add( /<r:.*>/g );
I removed it, and now the plugin works just as it should