I'm hoping someone here can help me. I'm trying to develop a plugin based on Placeholder. Much like Placeholder itself, I want to have a dialog box where I can enter text, then have that added to the page content, wrapped in specific symbols (eg, the [[ and ]] from placeholder. I use dollar signs for my wrappers).
I do use SPAN settings to mark this with a different color in the editing window, but then when it is saved (and in source mode), those span tags should be stripped out, leaving only the wrapper symbols and the true contents of what I entered in the popup box.
The problem I am running into is that the span tags aren't always getting fully cleaned up. Say the content is being displayed for editing using:
<span contenteditable="false" style="color: #ff0000" _fckplaceholder="actual contents">
It looks like this is consistently being picked up by the htmlNode._fckplaceholder part of the routine:
FCKXHtml.TagProcessors['span'] = function( node, htmlNode ) {
if ( htmlNode._fckplaceholder )
node = FCKXHtml.XML.createTextNode( '[[' + htmlNode._fckplaceholder + ']]' ) ;
However, the span tag is only removed entirely some of the time, leaving the actual contents inside the symbols, as I want them. Other times the span tag persists, actually saving in the output (where I don't want it) cleaned up partially to:
<span contenteditable="false" style="color: #ff0000">
This is running on the very same content, without making changes to it... it just works sometimes and doesn't other times (saving colors into the file that shouldn't be there). The problem seems to come and go... it happens often enough to bother me, but not 100% of the time.
I've done a few tests with the actual Placeholder plugin (out of the box), and haven't gotten this problem to crop up there... yet... but really the code that should handle this part is the same.
Has anyone else encountered this problem? Any tips are appreciated.
Peter
I do use SPAN settings to mark this with a different color in the editing window, but then when it is saved (and in source mode), those span tags should be stripped out, leaving only the wrapper symbols and the true contents of what I entered in the popup box.
The problem I am running into is that the span tags aren't always getting fully cleaned up. Say the content is being displayed for editing using:
<span contenteditable="false" style="color: #ff0000" _fckplaceholder="actual contents">
It looks like this is consistently being picked up by the htmlNode._fckplaceholder part of the routine:
FCKXHtml.TagProcessors['span'] = function( node, htmlNode ) {
if ( htmlNode._fckplaceholder )
node = FCKXHtml.XML.createTextNode( '[[' + htmlNode._fckplaceholder + ']]' ) ;
However, the span tag is only removed entirely some of the time, leaving the actual contents inside the symbols, as I want them. Other times the span tag persists, actually saving in the output (where I don't want it) cleaned up partially to:
<span contenteditable="false" style="color: #ff0000">
This is running on the very same content, without making changes to it... it just works sometimes and doesn't other times (saving colors into the file that shouldn't be there). The problem seems to come and go... it happens often enough to bother me, but not 100% of the time.
I've done a few tests with the actual Placeholder plugin (out of the box), and haven't gotten this problem to crop up there... yet... but really the code that should handle this part is the same.
Has anyone else encountered this problem? Any tips are appreciated.
Peter