Ticket #30966: 30966.10.patch
File 30966.10.patch, 901 bytes (added by , 9 years ago) |
---|
-
src/wp-admin/js/word-count.js
17 17 removeRegExp: /[0-9.(),;:!?%#$¿'"_+=\\\/-]+/g, 18 18 wordsRegExp: /\S\s+/g, 19 19 charactersRegExp: /\S/g, 20 allRegExp: /[^\n\r]/g, 20 21 l10n: window.wordCountL10n || {} 21 22 }; 22 23 … … 26 27 type = type || this.settings.l10n.type || 'words'; 27 28 28 29 if ( text ) { 29 text = ' ' + text + '';30 text = text + '\n'; 30 31 31 text = text.replace( this.settings.HTMLRegExp, ' 32 text = text.replace( this.settings.spaceRegExp, ' 32 text = text.replace( this.settings.HTMLRegExp, '\n' ); 33 text = text.replace( this.settings.spaceRegExp, '\n' ); 33 34 text = text.replace( this.settings.removeRegExp, '' ); 34 35 35 36 text = text.match( this.settings[ type + 'RegExp' ] );