I had the same issue and corrected it getting my hands dirt in the plugins code.
I'd have preferred a non-intrusive solution, but for now is still a solution.
My versions are:
fckeditor.class.php 1154 03-8-2009 Andrew
readmore.php 14401 2010-01-26 14:10:00Z louis
These files could have been modified by previous developers that worked on my client site, so I'm not sure you'll find the same lines of code.
I've first edited
plugins/editors/fckeditor.class.php changing the following line:
Code:
return " oFCKeditor.InsertHtml = '" . htmlentities($html) . "'; ";
with:
Code:
return " FCKeditorAPI.GetInstance('$editor').SetHTML('$html'); ";
I made this change because the original piece of code simply didn't work, as variable
oFCKeditor is not defined in the scope of the function
insertReadmore.
And then edited
plugins/editors-xtd/readmore.php changing the following block:
Code:
$js = "
function insertReadmore(editor) {
var content = $getContent
if (content.match(/<hr\s+id=(\"|')system-readmore(\"|')\s*\/*>/i)) {
alert('$present');
return false;
} else {
jInsertEditorText('<hr id=\"system-readmore\" />', editor);
}
}
";
with:
Code:
$setContent = $this->_subject->setContent($name, "'+content+'");
$js = "
function insertReadmore(editor) {
var content = $getContent
var systemReadmoreStr = '<hr id=\"system-readmore\" />';
if (content.match(/<hr\s+id=(\"|')system-readmore(\"|')\s*\/*>/i)) {
alert('$present');
} else {
jInsertEditorText(systemReadmoreStr, editor);
content = $getContent
}
content = content.replace(/(<(div|p)[^>]*>)?\s*<hr\s+id=(\"|')system-readmore(\"|')\s*\/*>\s*(<\/(div|p)>)?/i, systemReadmoreStr);
$setContent
}
";
What I do here is to replace any
hr element with id
"system-readmore" surrounded by a
div or
p element with the
hr element alone.
I placed it out of the
if statement just to make it easier for the editors to clean previous articles (they can open old article and simply click the "readmore button" to clean the article code and save.
It's a quick solution, I'm sure and hope someone will come out with a better solution.
Hope it helps
