Closed (won't fix)
Project:
Wysiwyg
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2009 at 20:32 UTC
Updated:
13 Dec 2009 at 04:30 UTC
I have installed and configured WYSIWYG together with the CKEditor and all is configured nicely and works well when doing normal node editing.
In a special scenario I'm using a textarea with the WYSIWYG editor on text fragments and collect those fragments in a custom module to build a node body out of them.
Now before going to node_save I would like to run the configured CKEditor filters on the module built body text. How would I do that?
Comments
Comment #1
twodI'm not sure I follow your line of thought here. CKEditor does not run any code serverside and has no filters dealing with contents after it has been uploaded, nor does Wysiwyg module. The only filters running on content are those belonging to the input format you've selected, and they run when the node is viewed.
Comment #2
jurgenhaasSo what are the cleanup settings in the wysiwyg profile there fore then? They can be different from the filter format settigs and I was wondering which of those do apply.
Also, does wysiwyg module allow invalid htnk if, say, the user edited in source code mode and forgot a closing tag?
Comment #3
twodThe Cleanup and output settings affect the output of the editor itself, ie what the raw contents look like in the original textarea when you've detached the editor, or when using an editor's Source mode. (An editor always detaches before form submit, so it never interferes with how the contents actually get to the server.) What you apply depends on what you want the editor to do for you. If you like neatly formatted HTML source code with indents, you check that box and the corresponding editor setting is activated.*
Wysiwyg module itself does not touch or care about the source as such, it only transports it between editors and generic Drupal plugins. The editor on the other hand will probably not tolerate invalid HTML (invalid XHTML is more tricky as it also depends on the browser). The editor will do its best to keep the markup sane, but it has no control over what Drupal does to it after submit.
*How true this is currently depends on which editor you are using. The profile settings are a leftover from when this module only supported TinyMCE, so not everything works in all editors. We intend to fix that in #313497: Allow configuration of advanced editor settings.
Comment #4
sunYou most likely cannot run JavaScript within a PHP operation. Though... if you can, then we would like you to become a Wysiwyg developer team member ;)
Or in other words: Drupal always stores the unprocessed user input. None of the "filters" (rather conversions) that wysiwyg editors apply should be required to save a content. They are entirely optional and only work for users with JS enabled.