With WYSIWYG module and the CKEDITOR CKEditor 3.5.2, everything installed just fine, aside from this problem, which I have solved http://drupal.org/node/1103448 however in moving over stuff from our plone site to drupal some of the pages have astronomical formula, with greek symbols (Delta...etc) when these were inserted into a page, either they disappeared and nothing was saved or the message this web site has had a problem would come up.
It seems that when saving the page, the editor would change the symbol Δ in the source code to a Delta symbol Δ. so that when it was saved again it barf up an error. I though this might be a filter problem but after playing with and turning of the filters nothing seemed to solve the problem.
There was some information about this problem, but it was old and referred more to the plain CKeditor module (in which this problem does not appear), I tried changes in the library by changing config.js, such as trying:
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#111';
config.htmlEncodeOutput = false;
config.entities=false;
};
However this and a few other proposed solutions did not work. I have given up and am using the CKeditor module, which works fine, however I would really like to solve this so that I can use the WYSIWYG module with a few other interesting modules that are coming out.
David
Comments
Comment #1
sunThe reason we do this is that content in non-English or non-Latin languages would otherwise contain plenty of converted HTML entities and potentially not a single plain character anymore. I.e., someone writing a post in Greek would see total garbage when looking at the HTML source code.
It looks like you tried to override the configuration via JS - however, did you already try to override it via the settings alter hook?
Comment #2
twodThe reason modifying config.js didn't work is because it's not being loaded. Wysiwyg generates all settings for the editor and passes them directly to the new editor instance when it's created.
As Sun said, you can override the generated settings, or add new ones, by implementing hook_wysiwyg_editor_settings_alter() in a custom module. (Example in wysiwyg.api.php and the issue queue.)
It should look something like this: (I can't guarantee these are the values you're looking for, just translating the snippet you posted to PHP for use in the hook.)
I don't think this is a bug but more of a consequence of the settings Drupal/Wysiwyg use as defaults.
Comment #3
dwalker51 commentedI had already tried that...thanks... with
function ckeditor_config_wysiwyg_editor_settings_alter(&$settings, &$context) {
if($context['profile']->editor == 'ckeditor') {
$settings['htmlEncodeOutput'] = FALSE;
$settings['entities'] = FALSE;
$settings['uiColor'] = '#ff0099';
}
}
The editor comes up with a lovely fuchsia, so something is being read..but it still shows a Δ in the source code. the exact error message is "The website encountered an unexpected error. Please try again later." and it doesn't save the content.
This is what I am a pasting :
Comment #4
twodPlease use <code></code> tags when posting snippets and special characters, makes it easer to determine if you really mean the literal
Δor the entityΔ.Am I right in that you want to store
Δas a single character, but getΔinstead?Setting the "entites", "entities_latin", "entities_greek" options to FALSE should stop the editor from inserting new glyphs as &something; entities, and prevent it from converting existing glyphs to entites as well. Wysiwyg sets the latter two to FALSE by default, and you set the first one to FALSE as well, so it should work. I made some quick tests with Wysiwyg's default settings and it showed up as
Δ, at least when copy/pasting from here. InsertingΔinto the source also got converted toΔ.Are you using a math filter for rendering this content? The error suggests something is going wrong on the server after the content has been submitted. Wysiwyg doesn't run any code a that point, it just detaches the editor before the form is submitted (same thing that happens if you click "Disable rich-text") to make the contents sync back to the original textarea.
Do you see any more detailed errors in any Drupal/PHP logs?
Btw, if you're using the Teaser Break plugin, please disable it and test without it, just to rule it out.
Comment #5
dwalker51 commentedI want to save
Δas mentioned.I copy from original page...and paste it into the editor
If I then view the source
This is what appears, the editor doesn't convert the Δ to Δ
when saving, the error comes up and it doesn't save the content.
If I try an experiment and open the editor , click source and type in
Δand then unclick the source button i get aΔgood!!
If I click source again I see:
And once again on saving, the error comes up.
In response to your other questions: No I am not using a math filter or the Teaser Break plugin.
Thanks again!
Comment #6
rainbowarrayThis is a completely unacceptable situation. HTML special characters need to be encoded, and every time I try to change quotation marks using either entities or their unicode equivalents, these are being turned back to normal text. This has the possibility of causing browser errors. I shouldn't have to create a new module to rectify this situation. At present, I'm going to look for a different module.
Comment #7
twodThanks for the clarification, I first thought you wanted the opposite result.
I don't understand what browser errors you're talking about, all browsers I'm aware of handle Unicode/UTF-8 fine, which is what Drupal outputs. W3's validator does not complain when not using
Δeither. This is why Wysiwyg changes CKEditor's entities_greek setting to false. See http://htmlpurifier.org/docs/enduser-utf8.html#whyutf8 for a quick explanation.I've not encountered any serverside errors when submitting non-entity Delta characters either, do any of the logs (Drupal, server etc) show any more details about the errors? You might need to change which PHP errors are displayed on the screen, since what you saw is a generic error displayed when the page could not be generated due to a fatal error. Sounds a lot like a module got can't handle Unicode/UTF-8 content. That might cause subtle errors elsewhere so I'd investigate that further by either testing with a fresh installation and adding modules until the errors happen, or by disabling modules on the site until the error goes away, to find out where things go wrong.
Anyway, I have confirmed that you can override Wysiwyg's settings for CKEditor like this
and it will output the Delta character as
Δand change the Quote character as well. It's very common to have a customization module for each site and this snippet could go there. In the future we'll create a GUI to change settings like this, at which point the snippet won't be needed anymore.I have also confirmed that the Teaser Break plugin will convert
Δback toΔ, so it needs to stay disabled until we can fix that.Comment #8
sunAs @TwoD already explained, this statement is invalid.
I don't think there's anything we can reasonably do here, as we're already doing the best that can be done to make HTML characters/entities conversion not break on multilingual or in general non-English sites. Also, I don't want to see a setting for this in the future.