Hi everyone - why don’t the FCK or MCE editors format the HTML source? It’s very frustrating -- HTML code is simply outputted in one long, wrapped line; hence, it’s almost impossible to edit or work with source code in the editors asit is un-readable - is this normal? Is there a fix for this? Am I doing something wrong? I would absolutely freak out if some one could tell me how to get MCE or FCK to format html source code in some sort of readable manner...
Steve
strange issue...have you tested with other browser?
Yes- it fails to format in mozilla and IE - and not just on my computer, but on all my co-workers’ computers as well - if I am to understand your email correctly, you are saying that this is not normal behavior, that newlines and carriage returns are normall respected and displayed appropriately? Beacsue that is not my experience - no newlines, carriage returns display in the source. I can go into the source, create a nicely formatted html document, then return to the source, and lo and behold I have a big jumbled mess of html...
Well, to be fair, MCE exhibits this trait as well. Are there any editor plugins for MODx that do not? Anyone? Also, I may have tracked down a fix for the FCK problem - however, fix needs to be applied to a file that I cannot find anywhere in the FCK distro in the MODx .91 that I curent use - the "fckcodeformatter.js" file - perhaps this file was not included in the MODx version? The lack of any source code formatting parsers would definitly give you a big blob of HTML..... See below:
Comments
Date: 2006-02-02 17:46
Sender: unleaded
Logged In: YES
user_id=67318
SF.net bugged up my comment and has added newlines..
Anyway, the correct RegEx should be:
/\<(BR|HR) [^\>]\>/gi ;
Date: 2006-02-02 17:45
Sender: unleaded
Logged In: YES
user_id=67318
I found the bug.. A very simple one as well.
In line 32 of fckcodeformatter.js, change:
"FCKCodeFormatter.Regex.NewLineTags =
/\<(BR|HR)[^\>]\>/gi ;"
to
"FCKCodeFormatter.Regex.NewLineTags = /\<(BR|HR)
[^\>]\>/gi ;"
Note: There’s a space now between "(BR|HR)" and
"[^\>]", as
there should be (eg,
).
One more note - and I hope the MODx support team responds -- it seems that this is a MODx issue, and not an editor problem - after perusing the tinyMCE and the FCKeditor websites, usage of their demo instances yielded the discovery that their instances formatted source when viewing or editing source in the respective editors. WHich begs the question, why does this extremely (to me, at least) function break when the editors are implemented in MODx? I’ve install Xinha, FCK and MCE now, and they **all** exhibit the same inability to provide formatted source code to the user when the user is using the HTML source option, but only in MODx.
Steve
That’s interesting. Hmm...if I were to guess at the source of the problem, I would suspect that the textarea box that FCKEditor and TinyMCE is replacing is not setup as a proper textarea and thus would probably explain the problem. When I get a moment, I’ll look into the problem. But, if you can, please submit this issue into the bugtracker just in case I forget.
Jeff Whitfield
"I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
Sure - I would be happy to do so....
steveua...
In the TinyMCE source pop-up window, there’s a check box called "Word wrap" in the upper right corner. It creates line breaks in the source code and fits it within the window.
The formatting isn’t pretty, but at least it’s all visible.
Duane
thanks duane - I tried that, but it was still just terrible to work with (in my opinion) - actually, in another part of the forum, somebody posted a manager fix that allows users to choose "none" as their editor - this replaces the chosen editor with a simple text box, and lo & behold, the code entered retains its formatting - I don’t have a link handy, but the 3 files I uploaded into the MODx manager were "mutate_content.dynamic.action.php
mutate_settings.dynamic.action.php
mutate_user.dynamic.action.php"
works great. I just wish MODx worked properly with the editors it use in terms of source code....