Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug where applying ins/del as inline elements would apply them …

…as blocks.
  • Loading branch information...
commit bd9d4689d683424c2f2ab0edbaf5bd1751537a0e 1 parent 164471a
@spocke spocke authored
View
2  changelog.txt
@@ -1,3 +1,5 @@
+Version 3.5.x (2012-xx-xx)
+ Fixed bug where applying ins/del as inline elements would apply them as blocks.
Version 3.5.8 (2012-11-20)
Fixed bug where html5 data attributes where stripped from contents.
Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
View
2  jscripts/tiny_mce/classes/Formatter.js
@@ -437,7 +437,7 @@
// Is it valid to wrap this item
if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) &&
- !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node)) {
+ !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!format.inline || !isBlock(node))) {
// Start wrapping
if (!currentWrapElm) {
// Wrap the node
View
24 tests/tinymce.Formatter_apply.html
@@ -1082,6 +1082,30 @@
equal(editor.getContent(), '<p>abc</p><p><span><b>def</b></span></p>', 'Text is bold');
});
+test('Del element wrapping blocks', function() {
+ editor.setContent('<p>a</p>');
+ setSelection('p', 0, 'p', 1);
+ editor.formatter.register('format', {block : 'del', wrapper: true});
+ editor.formatter.apply('format');
+ equal(getContent(), '<del><p>a</p></del>');
+});
+
+test('Del element replacing block', function() {
+ editor.setContent('<p>a</p>');
+ setSelection('p', 0, 'p', 1);
+ editor.formatter.register('format', {block : 'del'});
+ editor.formatter.apply('format');
+ equal(getContent(), '<del>a</del>');
+});
+
+test('Del element as inline', function() {
+ editor.setContent('<p>a</p>');
+ setSelection('p', 0, 'p', 1);
+ editor.formatter.register('format', {inline : 'del'});
+ editor.formatter.apply('format');
+ equal(getContent(), '<p><del>a</del></p>');
+});
+
test('Bug #5134 - TinyMCE removes formatting tags in the getContent', function() {
editor.setContent('');
editor.formatter.register('format', {inline : 'strong', toggle: false});
Please sign in to comment.
Something went wrong with that request. Please try again.