~canonical-sysadmins/wordpress/4.8.3

« back to all changes in this revision

Viewing changes to wp-admin/js/editor.js

  • Committer: axino
  • Date: 2017-03-07 07:21:12 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: axino@canonical.com-20170307072112-9g3xb2f6bb0skh02
Merge WP4.7.3 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
 
119
119
                // Replace paragraphs with double line breaks
120
120
                function removep( html ) {
121
 
                        var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset',
 
121
                        var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure',
122
122
                                blocklist1 = blocklist + '|div|p',
123
123
                                blocklist2 = blocklist + '|pre',
124
124
                                preserve_linebreaks = false,
257
257
                                });
258
258
                        }
259
259
 
 
260
                        if ( text.indexOf( '<figcaption' ) !== -1 ) {
 
261
                                text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' );
 
262
                                text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' );
 
263
                        }
 
264
 
260
265
                        // keep <br> tags inside captions and convert line breaks
261
266
                        if ( text.indexOf( '[caption' ) !== -1 ) {
262
267
                                preserve_br = true;