admin/config/content/wysiwyg/profile/XXXX/edit

Version 7.x-2.2 had Cleanup and Output -> Verify HTML, etc...

wysiwyg.admin.inc used to have:

  $form['output'] = array(
    '#type' => 'fieldset',
    '#title' => t('Cleanup and output'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  $form['output']['verify_html'] = array(
    '#type' => 'checkbox',
    '#title' => t('Verify HTML'),
    '#default_value' => $profile->settings['verify_html'],
    '#return_value' => 1,
    '#description' => t('If enabled, potentially malicious code like < code>&lt;HEAD&gt;</ code> tags will be removed from HTML contents.'),
  );

  $form['output']['preformatted'] = array(
    '#type' => 'checkbox',
    '#title' => t('Preformatted'),
    '#default_value' => $profile->settings['preformatted'],
    '#return_value' => 1,
    '#description' => t('If enabled, the editor will insert TAB characters on tab and preserve other whitespace characters just like a PRE element in HTML does.'),
  );

  $form['output']['convert_fonts_to_spans'] = array(
    '#type' => 'checkbox',
    '#title' => t('Convert &lt;font&gt; tags to styles'),
    '#default_value' => $profile->settings['convert_fonts_to_spans'],
    '#return_value' => 1,
    '#description' => t('If enabled, HTML tags declaring the font size, font family, font color and font background color will be replaced by inline CSS styles.'),
  );

  $form['output']['remove_linebreaks'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove linebreaks'),
    '#default_value' => $profile->settings['remove_linebreaks'],
    '#return_value' => 1,
    '#description' => t('If enabled, the editor will remove most linebreaks from contents. Disabling this option could avoid conflicts with other input filters.'),
  );

  $form['output']['apply_source_formatting'] = array(
    '#type' => 'checkbox',
    '#title' => t('Apply source formatting'),
    '#default_value' => $profile->settings['apply_source_formatting'],
    '#return_value' => 1,
    '#description' => t('If enabled, the editor will re-format the HTML source code. Disabling this option could avoid conflicts with other input filters.'),
  );

  $form['output']['paste_auto_cleanup_on_paste'] = array(
    '#type' => 'checkbox',
    '#title' => t('Force cleanup on standard paste'),
    '#default_value' => $profile->settings['paste_auto_cleanup_on_paste'],
    '#return_value' => 1,
    '#description' => t('If enabled, the default paste function (CTRL-V or SHIFT-INS) behaves like the "paste from word" plugin function.'),
  );

But now it just has:

$form['output'] = array(
    '#type' => 'fieldset',
    '#title' => t('Cleanup and output'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#group' => 'advanced',
  );

And I'd like to have that functionality back. What happened? Is there some other external module this functionality was pushed off to?

Comments

hermes_costell created an issue. See original summary.

hermes_costell’s picture

Issue summary: View changes
TwoD’s picture

Component: Code » User interface
Status: Active » Fixed
Issue tags: -ckeditor, -settings, -configuration, -wysiwyg ckeditor
Related issues: +#2018439: Move editor-specific options out of the default profile UI.

They've all been moved into the editor implementations and now only show up for the editors (and versions of them) where they actually make a difference.

hermes_costell’s picture

VERY impressed with your quick response!
So I can understand this better (and for anyone else who arrives here in the future) in the case of CKEditor (which I'm using) - is the idea that I go into libraries/ckeditor/config.js and edit it as needed, if I wanted one of those older features?

TwoD’s picture

Actually, no. That file is completely ignored as Wysiwyg passes all configuration data as an object into the editor instance. (It gets composed in PHP and passed down as JSON to the client.)

To customize the settings without touching Wysiwyg or the editor library at all, so you won't have to remember doing it again on updates, it's recommended to create a tiny Drupal module and have it implement hook_wysiwyg_editor_settings_alter(). Details on the hook are in wysiwyg.api.php and there are many examples here in the issue queue on what can be done if you search for that hook name.

If you can't find a GUI setting for what you want to change and translating it to PHP for the hook doesn't work well, I'd be happy to help here.

hermes_costell’s picture

Ok I'll check it out - thanks!

hermes_costell’s picture

Trying to make sense of how the data is passed to the editor and used, and looking across the fairly spread-out pieces of info here and there, I've encountered a spot which I find confusing:

It appears that there's either an error in an example you wrote, or there's some abstraction layer going on - Your first example on https://www.drupal.org/node/2834658 is:

function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'ckeditor') {
    $settings['protectedSources'] = array(
      wysiwyg_wrap_js_regexp('<%[\s\S]*?%>', 'g'), // ASP code
      wysiwyg_wrap_js_regexp('<%[\s\S]*?%>', 'g'), // ASP code
    );
  }
}

However the CKEditor documentation lists that setting as "protectedSource", rather than "protectedSources". http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-protectedSource
Is that simply a typo on your end? I'm asking because I'm really trying to get a handle on what the syntax needs to be to get the data passed correctly.

Thanks again.

TwoD’s picture

That example was llikely made for CKEditor 3.x, the setting has indeed changed its name in 4.x to "protectedSource". The rest looks fine and should work as expected (assuming you replace MYMODULE with the actual name of your module, of course).

hermes_costell’s picture

Thanks for the clarification.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.