WordPress.org

Make WordPress Core

Ticket #31441: 31441.16.patch

File 31441.16.patch, 1.1 KB (added by DrewAPicture, 5 years ago)

Docs

  • src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js

     
     1/**
     2 * WP Text Pattern plugin for TinyMCE
     3 *
     4 * @since 4.3.0
     5 *
     6 * This plugin can automatically format text patterns as you type. It includes two patterns:
     7 *  - unordered (`* ` and `- `)
     8 *  - ordered list (`1. ` and `1) `)
     9 *
     10 * If the transformation in unwanted, the user can undo the change by pressing backspace,
     11 * using the undo shortcut, or the undo button in the toolbar.
     12 */
     13
     14/* global tinymce */
    115( function( tinymce, setTimeout ) {
    216        tinymce.PluginManager.add( 'wptextpattern', function( editor ) {
    317                var $$ = editor.$,
     
    418                        patterns = [],
    519                        canUndo = false;
    620
     21                /**
     22                 * Add a pattern to format with a callback.
     23                 *
     24                 * @since 4.3.0
     25                 *
     26                 * @param {RegExp}   regExp
     27                 * @param {Function} callback
     28                 */
    729                function add( regExp, callback ) {
    830                        patterns.push( {
    931                                regExp: regExp,