Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3/tests/qunit/editor/tinymce/EnterKey.js

    r31700 r34029  
    1414            extended_valid_elements: 'div[id|style|contenteditable],span[id|style|contenteditable],#dt,#dd',
    1515            valid_styles: {
    16                 '*': 'color,font-size,font-family,background-color,font-weight,font-style,text-decoration,float,margin,margin-top,margin-right,margin-bottom,margin-left,display,position,top,left'
     16                '*' : 'color,font-size,font-family,background-color,font-weight,font-style,text-decoration,float,margin,margin-top,margin-right,margin-bottom,margin-left,display,position,top,left'
    1717            },
    1818            init_instance_callback: function(ed) {
     
    3737    Utils.setSelection('h1', 3);
    3838    Utils.pressEnter();
    39     equal(editor.getContent(),'<h1>abc</h1><p>\u00a0</p>');
     39    equal(editor.getContent(), '<h1>abc</h1><p>\u00a0</p>');
    4040    equal(editor.selection.getRng(true).startContainer.nodeName, 'P');
    4141});
     
    4545    Utils.setSelection('h1', 2);
    4646    Utils.pressEnter();
    47     equal(editor.getContent(),'<h1>ab</h1><h1>cd</h1>');
     47    equal(editor.getContent(), '<h1>ab</h1><h1>cd</h1>');
    4848    equal(editor.selection.getRng(true).startContainer.parentNode.nodeName, 'H1');
    4949});
     
    5353    editor.selection.setCursorLocation(editor.getBody().firstChild, 1);
    5454    Utils.pressEnter();
    55     equal(editor.getContent(),'<p><em>a</em></p><p>b</p>');
     55    equal(editor.getContent(), '<p><em>a</em></p><p>b</p>');
    5656    var rng = editor.selection.getRng(true);
    5757    equal(rng.startContainer.nodeValue, 'b');
     
    6262    editor.selection.setCursorLocation(editor.getBody().firstChild, 0);
    6363    Utils.pressEnter();
    64     equal(editor.getContent(),'<p>\u00a0</p><p><img src="about:blank" alt="" /></p>');
     64    equal(editor.getContent(), '<p>\u00a0</p><p><img src="about:blank" alt="" /></p>');
    6565});
    6666
     
    6969    editor.selection.setCursorLocation(editor.getBody().firstChild, 1);
    7070    Utils.pressEnter();
    71     equal(editor.getContent(),'<p>abc</p><p><img src="about:blank" alt="" /></p>');
     71    equal(editor.getContent(), '<p>abc</p><p><img src="about:blank" alt="" /></p>');
    7272    var rng = editor.selection.getRng(true);
    7373    equal(rng.startContainer.nodeName, 'P');
     
    7979    editor.selection.setCursorLocation(editor.getBody().firstChild, 1);
    8080    Utils.pressEnter();
    81     equal(editor.getContent(),'<p><img src="about:blank" alt="" /></p><p><img src="about:blank" alt="" /></p>');
     81    equal(editor.getContent(), '<p><img src="about:blank" alt="" /></p><p><img src="about:blank" alt="" /></p>');
    8282    var rng = editor.selection.getRng(true);
    8383    equal(rng.startContainer.nodeName, 'P');
     
    8989    editor.selection.setCursorLocation(editor.getBody().firstChild, 2);
    9090    Utils.pressEnter();
    91     equal(editor.getContent(),'<p>abc<img src="about:blank" alt="" /></p><p>\u00a0</p>');
     91    equal(editor.getContent(), '<p>abc<img src="about:blank" alt="" /></p><p>\u00a0</p>');
    9292});
    9393
     
    9696    editor.selection.setCursorLocation(editor.getBody().firstChild, 1);
    9797    Utils.pressEnter();
    98     equal(editor.getContent(),'<p>abc</p><p><input type="text" /></p>');
     98    equal(editor.getContent(), '<p>abc</p><p><input type="text" /></p>');
    9999    var rng = editor.selection.getRng(true);
    100100    equal(rng.startContainer.nodeName, 'P');
     
    106106    editor.selection.setCursorLocation(editor.getBody().firstChild, 1);
    107107    Utils.pressEnter();
    108     equal(editor.getContent(),'<p><input type="text" /></p><p><input type="text" /></p>');
     108    equal(editor.getContent(), '<p><input type="text" /></p><p><input type="text" /></p>');
    109109    var rng = editor.selection.getRng(true);
    110110    equal(rng.startContainer.nodeName, 'P');
     
    116116    editor.selection.setCursorLocation(editor.getBody().firstChild, 2);
    117117    Utils.pressEnter();
    118     equal(editor.getContent(),'<p>abc<input type="text" /></p><p>\u00a0</p>');
     118    equal(editor.getContent(), '<p>abc<input type="text" /></p><p>\u00a0</p>');
    119119});
    120120
     
    123123    Utils.setSelection('p', 3);
    124124    Utils.pressEnter();
    125     equal(editor.getContent(),'<p>abc</p><p>\u00a0</p>');
     125    equal(editor.getContent(), '<p>abc</p><p>\u00a0</p>');
    126126    equal(editor.selection.getRng(true).startContainer.nodeName, 'P');
    127127});
     
    139139    Utils.setSelection('em', 2);
    140140    Utils.pressEnter();
    141     equal(editor.getContent(),'<p><em>ab</em></p><p><em>cd</em></p>');
     141    equal(editor.getContent(), '<p><em>ab</em></p><p><em>cd</em></p>');
    142142    equal(editor.selection.getRng(true).startContainer.parentNode.nodeName, 'EM');
    143143});
     
    163163    Utils.setSelection('strong', 2);
    164164    Utils.pressEnter();
    165     equal(editor.getContent(),'<p><em><strong>ab</strong></em></p><p><em><strong>cd</strong></em></p>');
     165    equal(editor.getContent(), '<p><em><strong>ab</strong></em></p><p><em><strong>cd</strong></em></p>');
    166166    equal(editor.selection.getRng(true).startContainer.parentNode.nodeName, 'STRONG');
    167167});
     
    179179    Utils.setSelection('p', 0);
    180180    Utils.pressEnter();
    181     equal(editor.getContent(),'<p>\u00a0</p><p>abc</p>');
     181    equal(editor.getContent(), '<p>\u00a0</p><p>abc</p>');
    182182    equal(editor.selection.getRng(true).startContainer.nodeValue, 'abc');
    183183});
     
    187187    Utils.setSelection('p', 2);
    188188    Utils.pressEnter();
    189     equal(editor.getContent(),'<p id="a" class="b" style="color: #000;">ab</p><p class="b" style="color: #000;">cd</p>');
     189    equal(editor.getContent(), '<p id="a" class="b" style="color: #000;">ab</p><p class="b" style="color: #000;">cd</p>');
    190190    equal(editor.selection.getRng(true).startContainer.parentNode.nodeName, 'P');
    191191});
     
    195195    Utils.setSelection('h1', 2, 'p', 2);
    196196    Utils.pressEnter();
    197     equal(editor.getContent(),'<h1>abgh</h1>');
     197    equal(editor.getContent(), '<h1>abgh</h1>');
    198198    equal(editor.selection.getNode().nodeName, 'H1');
    199199});
     
    203203    Utils.setSelection('h1', 3);
    204204    Utils.pressEnter();
    205     equal(editor.getContent(),'<hgroup><h1>abc</h1><h1>\u00a0</h1></hgroup>');
     205    equal(editor.getContent(), '<hgroup><h1>abc</h1><h1>\u00a0</h1></hgroup>');
    206206    equal(editor.selection.getRng(true).startContainer.nodeName, 'H1');
    207207});
     
    227227    Utils.setSelection('body', 2);
    228228    Utils.pressEnter();
    229     equal(editor.getContent(),'<p>ab</p><p>cd</p>');
     229    equal(editor.getContent(), '<p>ab</p><p>cd</p>');
    230230    equal(editor.selection.getNode().nodeName, 'P');
    231231});
     
    235235    Utils.setSelection('body', 0);
    236236    Utils.pressEnter();
    237     equal(editor.getContent(),'<p>\u00a0</p><p>abcd</p>');
     237    equal(editor.getContent(), '<p>\u00a0</p><p>abcd</p>');
    238238    equal(editor.selection.getNode().nodeName, 'P');
    239239});
     
    243243    Utils.setSelection('body', 4);
    244244    Utils.pressEnter();
    245     equal(editor.getContent(),'<p>abcd</p><p>\u00a0</p>');
     245    equal(editor.getContent(), '<p>abcd</p><p>\u00a0</p>');
    246246    equal(editor.selection.getNode().nodeName, 'P');
    247247});
     
    251251    Utils.setSelection('body', 0);
    252252    Utils.pressEnter();
    253     equal(editor.getContent(),'<p>\u00a0</p><p>\u00a0</p>');
     253    equal(editor.getContent(), '<p>\u00a0</p><p>\u00a0</p>');
    254254    equal(editor.selection.getNode().nodeName, 'P');
    255255});
    256256
    257257test('Enter inside empty li in beginning of ol', function() {
    258     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li></li><li>a</li></ol>': '<ol><li><br></li><li>a</li></ol>';
     258    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li></li><li>a</li></ol>' : '<ol><li><br></li><li>a</li></ol>';
    259259    Utils.setSelection('li', 0);
    260260    Utils.pressEnter();
    261     equal(editor.getContent(),'<p>\u00a0</p><ol><li>a</li></ol>');
     261    equal(editor.getContent(), '<p>\u00a0</p><ol><li>a</li></ol>');
    262262    equal(editor.selection.getNode().nodeName, 'P');
    263263});
    264264
    265265test('Enter inside empty li at the end of ol', function() {
    266     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li></ol>': '<ol><li>a</li><li><br></li></ol>';
     266    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li></ol>' : '<ol><li>a</li><li><br></li></ol>';
    267267    Utils.setSelection('li:last', 0);
    268268    Utils.pressEnter();
    269     equal(editor.getContent(),'<ol><li>a</li></ol><p>\u00a0</p>');
     269    equal(editor.getContent(), '<ol><li>a</li></ol><p>\u00a0</p>');
    270270    equal(editor.selection.getNode().nodeName, 'P');
    271271});
    272272
    273273test('Shift+Enter inside empty li in the middle of ol', function() {
    274     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li><li>b</li></ol>': '<ol><li>a</li><li><br></li><li>b</li></ol>';
     274    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li><li>b</li></ol>' : '<ol><li>a</li><li><br></li><li>b</li></ol>';
    275275    Utils.setSelection('li:nth-child(2)', 0);
    276276    Utils.pressEnter({shiftKey: true});
    277     equal(editor.getContent(),'<ol><li>a</li></ol><p>\u00a0</p><ol><li>b</li></ol>');
     277    equal(editor.getContent(), '<ol><li>a</li></ol><p>\u00a0</p><ol><li>b</li></ol>');
    278278    equal(editor.selection.getNode().nodeName, 'P');
    279279});
    280280
    281281test('Shift+Enter inside empty li in beginning of ol', function() {
    282     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li></li><li>a</li></ol>': '<ol><li><br></li><li>a</li></ol>';
     282    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li></li><li>a</li></ol>' : '<ol><li><br></li><li>a</li></ol>';
    283283    Utils.setSelection('li', 0);
    284284    Utils.pressEnter({shiftKey: true});
    285     equal(editor.getContent(),'<p>\u00a0</p><ol><li>a</li></ol>');
     285    equal(editor.getContent(), '<p>\u00a0</p><ol><li>a</li></ol>');
    286286    equal(editor.selection.getNode().nodeName, 'P');
    287287});
    288288
    289289test('Shift+Enter inside empty li at the end of ol', function() {
    290     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li></ol>': '<ol><li>a</li><li><br></li></ol>';
     290    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li></ol>' : '<ol><li>a</li><li><br></li></ol>';
    291291    Utils.setSelection('li:last', 0);
    292292    Utils.pressEnter({shiftKey: true});
    293     equal(editor.getContent(),'<ol><li>a</li></ol><p>\u00a0</p>');
     293    equal(editor.getContent(), '<ol><li>a</li></ol><p>\u00a0</p>');
    294294    equal(editor.selection.getNode().nodeName, 'P');
    295295});
     
    297297test('Enter inside empty li in the middle of ol with forced_root_block: false', function() {
    298298    editor.settings.forced_root_block = false;
    299     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li><li>b</li></ol>': '<ol><li>a</li><li><br></li><li>b</li></ol>';
     299    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li><li>b</li></ol>' : '<ol><li>a</li><li><br></li><li>b</li></ol>';
    300300    Utils.setSelection('li:nth-child(2)', 0);
    301301    Utils.pressEnter();
    302     equal(editor.getContent(),'<ol><li>a</li></ol><br /><ol><li>b</li></ol>');
     302    equal(editor.getContent(), '<ol><li>a</li></ol><br /><ol><li>b</li></ol>');
    303303    equal(editor.selection.getNode().nodeName, 'BODY');
    304304});
     
    306306test('Enter inside empty li in beginning of ol with forced_root_block: false', function() {
    307307    editor.settings.forced_root_block = false;
    308     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li></li><li>a</li></ol>': '<ol><li><br></li><li>a</li></ol>';
     308    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li></li><li>a</li></ol>' : '<ol><li><br></li><li>a</li></ol>';
    309309    Utils.setSelection('li', 0);
    310310    Utils.pressEnter();
    311     equal(editor.getContent(),'<br /><ol><li>a</li></ol>');
     311    equal(editor.getContent(), '<br /><ol><li>a</li></ol>');
    312312    equal(editor.selection.getNode().nodeName, 'BODY');
    313313});
     
    315315test('Enter inside empty li at the end of ol with forced_root_block: false', function() {
    316316    editor.settings.forced_root_block = false;
    317     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li></ol>': '<ol><li>a</li><li><br></li></ol>';
     317    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li></ol>' : '<ol><li>a</li><li><br></li></ol>';
    318318    Utils.setSelection('li:last', 0);
    319319    Utils.pressEnter();
     
    323323
    324324test('Enter inside empty li in the middle of ol', function() {
    325     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li><li>b</li></ol>': '<ol><li>a</li><li><br></li><li>b</li></ol>';
     325    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li>a</li><li></li><li>b</li></ol>' : '<ol><li>a</li><li><br></li><li>b</li></ol>';
    326326    Utils.setSelection('li:nth-child(2)', 0);
    327327    Utils.pressEnter();
    328     equal(editor.getContent(),'<ol><li>a</li></ol><p>\u00a0</p><ol><li>b</li></ol>');
     328    equal(editor.getContent(), '<ol><li>a</li></ol><p>\u00a0</p><ol><li>b</li></ol>');
    329329    equal(editor.selection.getNode().nodeName, 'P');
    330330});
     
    558558    Utils.setSelection('dt', 0);
    559559    Utils.pressEnter();
    560     equal(editor.getContent(),'<dl><dt>\u00a0</dt><dt>a</dt></dl>');
     560    equal(editor.getContent(), '<dl><dt>\u00a0</dt><dt>a</dt></dl>');
    561561    equal(editor.selection.getNode().nodeName, 'DT');
    562562});
     
    566566    Utils.setSelection('dd', 0);
    567567    Utils.pressEnter();
    568     equal(editor.getContent(),'<dl><dd>\u00a0</dd><dd>a</dd></dl>');
     568    equal(editor.getContent(), '<dl><dd>\u00a0</dd><dd>a</dd></dl>');
    569569    equal(editor.selection.getNode().nodeName, 'DD');
    570570});
     
    574574    Utils.setSelection('dt:nth-child(2)', 0);
    575575    Utils.pressEnter();
    576     equal(editor.getContent(),'<dl><dt>a</dt><dt>\u00a0</dt><dt>b</dt><dt>c</dt></dl>');
     576    equal(editor.getContent(), '<dl><dt>a</dt><dt>\u00a0</dt><dt>b</dt><dt>c</dt></dl>');
    577577    equal(editor.selection.getNode().nodeName, 'DT');
    578578});
     
    582582    Utils.setSelection('dd:nth-child(2)', 0);
    583583    Utils.pressEnter();
    584     equal(editor.getContent(),'<dl><dd>a</dd><dd>\u00a0</dd><dd>b</dd><dd>c</dd></dl>');
     584    equal(editor.getContent(), '<dl><dd>a</dd><dd>\u00a0</dd><dd>b</dd><dd>c</dd></dl>');
    585585    equal(editor.selection.getNode().nodeName, 'DD');
    586586});
     
    590590    Utils.setSelection('dt', 1);
    591591    Utils.pressEnter();
    592     equal(editor.getContent(),'<dl><dt>a</dt><dt>\u00a0</dt></dl>');
     592    equal(editor.getContent(), '<dl><dt>a</dt><dt>\u00a0</dt></dl>');
    593593    equal(editor.selection.getNode().nodeName, 'DT');
    594594});
     
    598598    Utils.setSelection('dd', 1);
    599599    Utils.pressEnter();
    600     equal(editor.getContent(),'<dl><dd>a</dd><dd>\u00a0</dd></dl>');
     600    equal(editor.getContent(), '<dl><dd>a</dd><dd>\u00a0</dd></dl>');
    601601    equal(editor.selection.getNode().nodeName, 'DD');
    602602});
     
    606606    Utils.setSelection('dt:nth-child(2)', 0);
    607607    Utils.pressEnter();
    608     equal(editor.getContent(),'<dl><dt>a</dt></dl><p>\u00a0</p>');
     608    equal(editor.getContent(), '<dl><dt>a</dt></dl><p>\u00a0</p>');
    609609    equal(editor.selection.getNode().nodeName, 'P');
    610610});
     
    614614    Utils.setSelection('dd:nth-child(2)', 0);
    615615    Utils.pressEnter();
    616     equal(editor.getContent(),'<dl><dd>a</dd></dl><p>\u00a0</p>');
     616    equal(editor.getContent(), '<dl><dd>a</dd></dl><p>\u00a0</p>');
    617617    equal(editor.selection.getNode().nodeName, 'P');
    618618});
     
    622622    Utils.setSelection('p', 0);
    623623    Utils.pressEnter();
    624     equal(editor.getContent(),'<ol><li></li><li><p>abcd</p></li></ol>');
     624    equal(editor.getContent(), '<ol><li></li><li><p>abcd</p></li></ol>');
    625625    equal(editor.selection.getNode().nodeName, 'P');
    626626});
     
    630630    Utils.setSelection('p', 2);
    631631    Utils.pressEnter();
    632     equal(editor.getContent(),'<ol><li><p>ab</p></li><li><p>cd</p></li></ol>');
     632    equal(editor.getContent(), '<ol><li><p>ab</p></li><li><p>cd</p></li></ol>');
    633633
    634634    // Ignore on IE 7, 8 this is a known bug not worth fixing
     
    642642    Utils.setSelection('p', 4);
    643643    Utils.pressEnter();
    644     equal(editor.getContent(),'<ol><li><p>abcd</p></li><li></li></ol>');
     644    equal(editor.getContent(), '<ol><li><p>abcd</p></li><li></li></ol>');
    645645    equal(editor.selection.getNode().nodeName, 'LI');
    646646});
     
    651651    Utils.setSelection('p', 0);
    652652    Utils.pressEnter({shiftKey: true});
    653     equal(editor.getContent(),'<ol><li><p><br />abcd</p></li></ol>');
     653    equal(editor.getContent(), '<ol><li><p><br />abcd</p></li></ol>');
    654654    equal(editor.selection.getNode().nodeName, 'P');
    655655});
     
    659659    Utils.setSelection('p', 2);
    660660    Utils.pressEnter({shiftKey: true});
    661     equal(editor.getContent(),'<ol><li><p>ab<br />cd</p></li></ol>');
     661    equal(editor.getContent(), '<ol><li><p>ab<br />cd</p></li></ol>');
    662662    equal(editor.selection.getNode().nodeName, 'P');
    663663});
     
    667667    Utils.setSelection('p', 4);
    668668    Utils.pressEnter({shiftKey: true});
    669     equal(editor.getContent(),(tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li><p>abcd</p></li></ol>': '<ol><li><p>abcd<br /><br /></p></li></ol>');
     669    equal(editor.getContent(), (tinymce.isIE && tinymce.Env.ie < 11) ? '<ol><li><p>abcd</p></li></ol>' : '<ol><li><p>abcd<br /><br /></p></li></ol>');
    670670    equal(editor.selection.getNode().nodeName, 'P');
    671671});
     
    676676    Utils.setSelection('p', 0);
    677677    Utils.pressEnter({ctrlKey: true});
    678     equal(editor.getContent(),'<ol><li><p>\u00a0</p><p>abcd</p></li></ol>');
     678    equal(editor.getContent(), '<ol><li><p>\u00a0</p><p>abcd</p></li></ol>');
    679679    equal(editor.selection.getNode().nodeName, 'P');
    680680});
     
    684684    Utils.setSelection('p', 2);
    685685    Utils.pressEnter({ctrlKey: true});
    686     equal(editor.getContent(),'<ol><li><p>ab</p><p>cd</p></li></ol>');
     686    equal(editor.getContent(), '<ol><li><p>ab</p><p>cd</p></li></ol>');
    687687    equal(editor.selection.getNode().nodeName, 'P');
    688688});
     
    692692    Utils.setSelection('p', 4);
    693693    Utils.pressEnter({ctrlKey: true});
    694     equal(editor.getContent(),'<ol><li><p>abcd</p><p>\u00a0</p></li></ol>');
     694    equal(editor.getContent(), '<ol><li><p>abcd</p><p>\u00a0</p></li></ol>');
    695695    equal(editor.selection.getNode().nodeName, 'P');
    696696});
     
    702702    Utils.setSelection('p', 2);
    703703    Utils.pressEnter();
    704     equal(editor.getContent(),'<p>ab<br />c</p>');
     704    equal(editor.getContent(), '<p>ab<br />c</p>');
    705705});
    706706
     
    710710    Utils.setSelection('p', 3);
    711711    Utils.pressEnter();
    712     equal(Utils.cleanHtml(editor.getBody().innerHTML), (tinymce.isIE && tinymce.Env.ie < 11) ? '<p>abc<br></p>': '<p>abc<br><br></p>');
     712    equal(Utils.cleanHtml(editor.getBody().innerHTML), (tinymce.isIE && tinymce.Env.ie < 11) ? '<p>abc<br></p>' : '<p>abc<br><br></p>');
    713713});
    714714
     
    737737    editor.focus();
    738738    Utils.pressEnter();
    739     equal(Utils.cleanHtml(editor.getBody().innerHTML), (tinymce.isIE && tinymce.Env.ie < 11) ? 'abcd<br>': 'abcd<br><br>');
     739    equal(Utils.cleanHtml(editor.getBody().innerHTML), (tinymce.isIE && tinymce.Env.ie < 11) ? 'abcd<br>' : 'abcd<br><br>');
    740740});
    741741
    742742test('Enter in empty P at the end of a blockquote and end_container_on_empty_block: true', function() {
    743743    editor.settings.end_container_on_empty_block = true;
    744     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<blockquote><p>abc</p><p></p></blockquote>': '<blockquote><p>abc</p><p><br></p></blockquote>';
     744    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<blockquote><p>abc</p><p></p></blockquote>' : '<blockquote><p>abc</p><p><br></p></blockquote>';
    745745    Utils.setSelection('p:last', 0);
    746746    Utils.pressEnter();
    747     equal(editor.getContent(),'<blockquote><p>abc</p></blockquote><p>\u00a0</p>');
     747    equal(editor.getContent(), '<blockquote><p>abc</p></blockquote><p>\u00a0</p>');
    748748});
    749749
    750750test('Enter in empty P at the beginning of a blockquote and end_container_on_empty_block: true', function() {
    751751    editor.settings.end_container_on_empty_block = true;
    752     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<blockquote><p></p><p>abc</p></blockquote>': '<blockquote><p><br></p><p>abc</p></blockquote>';
     752    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<blockquote><p></p><p>abc</p></blockquote>' : '<blockquote><p><br></p><p>abc</p></blockquote>';
    753753    Utils.setSelection('p', 0);
    754754    Utils.pressEnter();
    755     equal(editor.getContent(),'<p>\u00a0</p><blockquote><p>abc</p></blockquote>');
     755    equal(editor.getContent(), '<p>\u00a0</p><blockquote><p>abc</p></blockquote>');
    756756});
    757757
    758758test('Enter in empty P at in the middle of a blockquote and end_container_on_empty_block: true', function() {
    759759    editor.settings.end_container_on_empty_block = true;
    760     editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<blockquote><p>abc</p><p></p><p>123</p></blockquote>': '<blockquote><p>abc</p><p><br></p><p>123</p></blockquote>';
     760    editor.getBody().innerHTML = (tinymce.isIE && tinymce.Env.ie < 11) ? '<blockquote><p>abc</p><p></p><p>123</p></blockquote>' : '<blockquote><p>abc</p><p><br></p><p>123</p></blockquote>';
    761761    Utils.setSelection('p:nth-child(2)', 0);
    762762    Utils.pressEnter();
    763     equal(editor.getContent(),'<blockquote><p>abc</p></blockquote><p>\u00a0</p><blockquote><p>123</p></blockquote>');
     763    equal(editor.getContent(), '<blockquote><p>abc</p></blockquote><p>\u00a0</p><blockquote><p>123</p></blockquote>');
    764764});
    765765
     
    769769    Utils.setSelection('p', 0);
    770770    Utils.pressEnter();
    771     equal(editor.getContent(),'<p>\u00a0</p><p>\u00a0</p><p>\u00a0</p><p>X</p>');
     771    equal(editor.getContent(), '<p>\u00a0</p><p>\u00a0</p><p>\u00a0</p><p>X</p>');
    772772});
    773773
     
    777777    Utils.setSelection('h1', 1);
    778778    Utils.pressEnter();
    779     equal(editor.getContent(),'<h1>a</h1><p class="class1">\u00a0</p>');
     779    equal(editor.getContent(), '<h1>a</h1><p class="class1">\u00a0</p>');
    780780});
    781781
     
    784784    Utils.setSelection('p', 0);
    785785    Utils.pressEnter({shiftKey: true});
    786     equal(editor.getContent(),'<p><br />abc</p>');
     786    equal(editor.getContent(), '<p><br />abc</p>');
    787787});
    788788
     
    791791    Utils.setSelection('p', 2);
    792792    Utils.pressEnter({shiftKey: true});
    793     equal(editor.getContent(),'<p>ab<br />cd</p>');
     793    equal(editor.getContent(), '<p>ab<br />cd</p>');
    794794});
    795795
     
    798798    Utils.setSelection('p', 4);
    799799    Utils.pressEnter({shiftKey: true});
    800     equal(editor.getContent(),(tinymce.isIE && tinymce.Env.ie < 11) ? '<p>abcd</p>': '<p>abcd<br /><br /></p>');
     800    equal(editor.getContent(), (tinymce.isIE && tinymce.Env.ie < 11) ? '<p>abcd</p>' : '<p>abcd<br /><br /></p>');
    801801});
    802802
     
    805805    Utils.setSelection('b', 2);
    806806    Utils.pressEnter({shiftKey: true});
    807     equal(editor.getContent(),'<p><b>ab<br />cd</b></p>');
     807    equal(editor.getContent(), '<p><b>ab<br />cd</b></p>');
    808808});
    809809
     
    812812    Utils.setSelection('b', 4);
    813813    Utils.pressEnter({shiftKey: true});
    814     equal(editor.getContent(),'<p><b>abcd<br /></b></p>');
     814    equal(editor.getContent(), '<p><b>abcd<br /></b></p>');
    815815});
    816816
     
    819819    Utils.setSelection('pre', 0);
    820820    Utils.pressEnter();
    821     equal(editor.getContent(),'<pre><br />abc</pre>');
     821    equal(editor.getContent(), '<pre><br />abc</pre>');
    822822});
    823823
     
    826826    Utils.setSelection('pre', 2);
    827827    Utils.pressEnter();
    828     equal(editor.getContent(),'<pre>ab<br />cd</pre>');
     828    equal(editor.getContent(), '<pre>ab<br />cd</pre>');
    829829});
    830830
     
    833833    Utils.setSelection('pre', 4);
    834834    Utils.pressEnter();
    835     equal(editor.getContent(),(tinymce.isIE && tinymce.Env.ie < 11) ? '<pre>abcd</pre>': '<pre>abcd<br /><br /></pre>');
     835    equal(editor.getContent(), (tinymce.isIE && tinymce.Env.ie < 11) ? '<pre>abcd</pre>' : '<pre>abcd<br /><br /></pre>');
    836836});
    837837
     
    841841    Utils.setSelection('pre', 0);
    842842    Utils.pressEnter();
    843     equal(editor.getContent(),'<pre>\u00a0</pre><pre>abc</pre>');
     843    equal(editor.getContent(), '<pre>\u00a0</pre><pre>abc</pre>');
    844844});
    845845
     
    849849    Utils.setSelection('pre', 2);
    850850    Utils.pressEnter();
    851     equal(editor.getContent(),'<pre>ab</pre><pre>cd</pre>');
     851    equal(editor.getContent(), '<pre>ab</pre><pre>cd</pre>');
    852852});
    853853
     
    857857    Utils.setSelection('pre', 4);
    858858    Utils.pressEnter();
    859     equal(editor.getContent(),'<pre>abcd</pre><p>\u00a0</p>');
     859    equal(editor.getContent(), '<pre>abcd</pre><p>\u00a0</p>');
    860860});
    861861
     
    864864    Utils.setSelection('pre', 0);
    865865    Utils.pressEnter({shiftKey: true});
    866     equal(editor.getContent(),'<pre>\u00a0</pre><pre>abc</pre>');
     866    equal(editor.getContent(), '<pre>\u00a0</pre><pre>abc</pre>');
    867867});
    868868
     
    871871    Utils.setSelection('pre', 2);
    872872    Utils.pressEnter({shiftKey: true});
    873     equal(editor.getContent(),'<pre>ab</pre><pre>cd</pre>');
     873    equal(editor.getContent(), '<pre>ab</pre><pre>cd</pre>');
    874874});
    875875
     
    878878    Utils.setSelection('pre', 4);
    879879    Utils.pressEnter({shiftKey: true});
    880     equal(editor.getContent(),'<pre>abcd</pre><p>\u00a0</p>');
     880    equal(editor.getContent(), '<pre>abcd</pre><p>\u00a0</p>');
    881881});
    882882
     
    886886    Utils.setSelection('p', 0);
    887887    Utils.pressEnter({shiftKey: true});
    888     equal(editor.getContent(),'<p>\u00a0</p><p>abc</p>');
     888    equal(editor.getContent(), '<p>\u00a0</p><p>abc</p>');
    889889});
    890890
     
    894894    Utils.setSelection('p', 2);
    895895    Utils.pressEnter({shiftKey: true});
    896     equal(editor.getContent(),'<p>ab</p><p>cd</p>');
     896    equal(editor.getContent(), '<p>ab</p><p>cd</p>');
    897897});
    898898
     
    902902    Utils.setSelection('p', 3);
    903903    Utils.pressEnter({shiftKey: true});
    904     equal(editor.getContent(),'<p>abc</p><p>\u00a0</p>');
     904    equal(editor.getContent(), '<p>abc</p><p>\u00a0</p>');
    905905});
    906906
     
    913913    editor.selection.setRng(rng);
    914914    Utils.pressEnter({shiftKey: true});
    915     equal(editor.getContent(),'<p>ab</p><p>cd</p>');
     915    equal(editor.getContent(), '<p>ab</p><p>cd</p>');
    916916});
    917917
     
    921921    Utils.setSelection('div', 4);
    922922    Utils.pressEnter();
    923     equal(editor.getContent(),'<div style="position: absolute; top: 1px; left: 2px;"><p>abcd</p><p>\u00a0</p></div>');
     923    equal(editor.getContent(), '<div style="position: absolute; top: 1px; left: 2px;"><p>abcd</p><p>\u00a0</p></div>');
    924924});
    925925
     
    972972    Utils.setSelection('span', 1);
    973973    Utils.pressEnter();
    974     equal(editor.getContent(),'<p><em><span style="font-size: 13px;">X</span></em></p><p>\u00a0</p>');
     974    equal(editor.getContent(), '<p><em><span style="font-size: 13px;">X</span></em></p><p>\u00a0</p>');
    975975});
    976976
     
    980980    Utils.setSelection('li', 2);
    981981    Utils.pressEnter({shiftKey: true});
    982     equal(editor.getContent(),'<ul><li>te<br />xt</li></ul>');
     982    equal(editor.getContent(), '<ul><li>te<br />xt</li></ul>');
    983983});
    984984
     
    989989    Utils.setSelection('body', 2);
    990990    Utils.pressEnter();
    991     equal(editor.getContent(),'<p>te</p><p>xt</p>');
     991    equal(editor.getContent(), '<p>te</p><p>xt</p>');
    992992});
    993993
     
    10141014        editor.selection.setRng(rng);
    10151015        Utils.pressEnter();
    1016         equal(editor.getContent(),'<div>a<span>b</span>c</div><p>\u00a0</p><p>\u00a0</p><div>d</div>');
     1016        equal(editor.getContent(), '<div>a<span>b</span>c</div><p>\u00a0</p><p>\u00a0</p><div>d</div>');
    10171017    });
    10181018}
     
    10291029
    10301030        Utils.pressEnter();
    1031         equal(editor.getContent(),'<table><tbody><tr><td>x</td></tr></tbody></table><p>\u00a0</p>');
     1031        equal(editor.getContent(), '<table><tbody><tr><td>x</td></tr></tbody></table><p>\u00a0</p>');
    10321032    });
    10331033
     
    10411041
    10421042        Utils.pressEnter();
    1043         equal(editor.getContent(),'<p>\u00a0</p><table><tbody><tr><td>x</td></tr></tbody></table>');
     1043        equal(editor.getContent(), '<p>\u00a0</p><table><tbody><tr><td>x</td></tr></tbody></table>');
    10441044    });
    10451045
     
    10531053
    10541054        Utils.pressEnter();
    1055         equal(editor.getContent(),'<table><tbody><tr><td>x</td></tr></tbody></table><p>\u00a0</p><p>x</p>');
     1055        equal(editor.getContent(), '<table><tbody><tr><td>x</td></tr></tbody></table><p>\u00a0</p><p>x</p>');
    10561056    });
    10571057
     
    10651065
    10661066        Utils.pressEnter();
    1067         equal(editor.getContent(),'<p>x</p><p>\u00a0</p><table><tbody><tr><td>x</td></tr></tbody></table>');
     1067        equal(editor.getContent(), '<p>x</p><p>\u00a0</p><table><tbody><tr><td>x</td></tr></tbody></table>');
    10681068    });
    10691069
     
    10781078        Utils.pressEnter();
    10791079        Utils.pressEnter();
    1080         equal(editor.getContent(),'<p>\u00a0</p><p>\u00a0</p><table><tbody><tr><td>x</td></tr></tbody></table>');
     1080        equal(editor.getContent(), '<p>\u00a0</p><p>\u00a0</p><table><tbody><tr><td>x</td></tr></tbody></table>');
     1081    });
     1082
     1083    test('Enter after span with space', function() {
     1084        editor.setContent('<p><b>abc </b></p>');
     1085        Utils.setSelection('b', 3);
     1086        Utils.pressEnter();
     1087        equal(editor.getContent(), '<p><b>abc</b></p><p>\u00a0</p>');
     1088
     1089        var rng = editor.selection.getRng(true);
     1090        equal(rng.startContainer.nodeName, 'B');
     1091        notEqual(rng.startContainer.data, ' ');
    10811092    });
    10821093}
Note: See TracChangeset for help on using the changeset viewer.