Make WordPress Core

Ticket #27907: 27907.qunit.patch

File 27907.qunit.patch, 1.0 KB (added by Clorith, 12 years ago)

qunit tests for catching newlines in escaped shortcodes

  • tests/qunit/wp-includes/js/shortcode.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    5757                equal( result, undefined, 'foo shortcode not found when escaped with params' );
    5858        });
    5959
     60        test( 'next() should find shortcodes that are incorrectly escaped by newlines', function() {
     61                var result;
     62
     63                result = wp.shortcode.next( 'foo', "this has the [\n[foo]] shortcode" );
     64                equal( result.index, 15, 'shortcode found when incorrectly escaping the start of it' );
     65
     66                result = wp.shortcode.next( 'foo', 'this has the [[foo]\n] shortcode' );
     67                equal( result.index, 13, 'shortcode found when incorrectly escaping the end of it' );
     68        });
     69
    6070        test( 'next() should find the second instances of the shortcode when the first one is escaped', function() {
    6171                var result;
    6272