Index: wysiwyg.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.js,v retrieving revision 1.15.2.2 diff -u -p -r1.15.2.2 wysiwyg.js --- wysiwyg.js 13 Feb 2010 23:58:41 -0000 1.15.2.2 +++ wysiwyg.js 11 Apr 2010 13:44:28 -0000 @@ -212,6 +212,19 @@ Drupal.wysiwyg.getParams = function(elem }; /** + * Removes unwanted 'blank'
and
tags from an HTML string.
+ *
+ * Editors sometimes leave tags like
when nothing was entered. + * This function removes those tags to allow for truly empty fields. + * + * @param content + * An HTML string to remove tags from. + */ +Drupal.wysiwyg.removeBlankTags = function(content) { + return content.replace(/^(?:
(?: |\s*)<\/p>|
)$/i, '');
+}
+
+/**
* Allow certain editor libraries to initialize before the DOM is loaded.
*/
Drupal.wysiwygInit();
Index: editors/js/fckeditor-2.6.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/js/fckeditor-2.6.js,v
retrieving revision 1.16.2.3
diff -u -p -r1.16.2.3 fckeditor-2.6.js
--- editors/js/fckeditor-2.6.js 13 Feb 2010 23:58:41 -0000 1.16.2.3
+++ editors/js/fckeditor-2.6.js 11 Apr 2010 13:44:28 -0000
@@ -88,7 +88,7 @@ Drupal.wysiwyg.editor.instance.fckeditor
data = Drupal.wysiwyg.plugins[plugin].detach(data, Drupal.settings.wysiwyg.plugins.drupal[plugin], instance.FCK.Name);
}
}
- return data;
+ return Drupal.wysiwyg.removeBlankTags(data);
};
instance.FCK.DataProcessor = new wysiwygDataProcessor();
},
Index: editors/js/ckeditor-3.0.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/js/ckeditor-3.0.js,v
retrieving revision 1.2.4.5
diff -u -p -r1.2.4.5 ckeditor-3.0.js
--- editors/js/ckeditor-3.0.js 17 Nov 2009 15:31:33 -0000 1.2.4.5
+++ editors/js/ckeditor-3.0.js 11 Apr 2010 13:44:28 -0000
@@ -79,7 +79,7 @@ Drupal.wysiwyg.editor.attach.ckeditor =
pluginsLoaded: function(ev) {
// Override the conversion methods to let Drupal plugins modify the data.
var editor = ev.editor;
- if (editor.dataProcessor && Drupal.settings.wysiwyg.plugins[params.format]) {
+ if (editor.dataProcessor) {
editor.dataProcessor.toHtml = CKEDITOR.tools.override(editor.dataProcessor.toHtml, function(originalToHtml) {
// Convert raw data for display in WYSIWYG mode.
return function(data, fixForBody) {
@@ -101,7 +101,7 @@ Drupal.wysiwyg.editor.attach.ckeditor =
data = Drupal.wysiwyg.plugins[plugin].detach(data, Drupal.settings.wysiwyg.plugins.drupal[plugin], editor.name);
}
}
- return data;
+ return Drupal.wysiwyg.removeBlankTags(data);
};
});
}