mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Rename wp_caption shortcode to caption. Allow themes to disable captioning. Use dashes instead of underscores in class names. Props azaozz. see #6812
git-svn-id: https://develop.svn.wordpress.org/trunk@8313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -52,8 +52,8 @@ switchEditors = {
|
||||
// Fix some block element newline issues
|
||||
content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
|
||||
content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
|
||||
content = content.replace(new RegExp('\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n');
|
||||
content = content.replace(new RegExp('wp_caption\\]\\n\\n+\\[wp_caption', 'g'), 'wp_caption]\n\n[wp_caption');
|
||||
content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
|
||||
content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
|
||||
|
||||
var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
|
||||
content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
|
||||
@@ -166,7 +166,7 @@ switchEditors = {
|
||||
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
|
||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
|
||||
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
|
||||
pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[wp_caption$1[/wp_caption]');
|
||||
pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
|
||||
// pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 ');
|
||||
|
||||
// Fix the pre|script tags
|
||||
|
||||
@@ -5,7 +5,7 @@ function send_to_editor(h) {
|
||||
if (tinymce.isIE)
|
||||
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
|
||||
|
||||
if ( h.indexOf('[wp_caption') != -1 )
|
||||
if ( h.indexOf('[caption') != -1 )
|
||||
h = ed.plugins.wpeditimage._do_shcode(h);
|
||||
|
||||
ed.execCommand('mceInsertContent', false, h);
|
||||
|
||||
Reference in New Issue
Block a user