Closed (cannot reproduce)
Project:
Wysiwyg
Version:
7.x-2.1
Component:
Plugins
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2011 at 14:14 UTC
Updated:
11 Aug 2012 at 18:06 UTC
I made plugin with a button than should wrap the selected text like that:
<h2><span>selection</span></h2>
The problem is than the span look like filter out. If I use em instead it works fine.
- no HTML filter in my text style.
- line break on
- use ckeditor
My JS:
invoke: function(data, settings, instanceId) {
content = this._addWrapper(data.content);
// Insert new content into the editor.
if (typeof content != 'undefined') {
Drupal.wysiwyg.instances[instanceId].insert(content);
}
},
_addWrapper: function(htmlContent) {
return '<h2><span>' + htmlContent + '</span></h2>';
}
Comments
Comment #1
twodWhen is the span being filtered out?
Is it still there if you "View source/HTML" in the editor?
Is it still there if you click "Disable rich-text"?
If so, is it still there after saving the node, editing it again and clicking "Disable rich-text"?
Btw, note that your if-statment:
if (typeof content != 'undefined') {will never be false since you always return a string from_addWrapper()no matter what was passed to it.Comment #2
marcoka commentedcheck the textformat, filters. do you use restrict HTML. i am using ckeditor too and also wrote a plugin via the ckeditor api and nothing is beeing stripped out.
reopen if it is still a problem.