Add a class to the TinyMCE view end marker.
Certain TinyMCE plugins scan for all spans in the document and remove any that do not have classes (or a handful of other attributes). This is quite aggressive, and breaks the regex used to scan for MCE views when transforming them back to plain text. Adding a class ensures that any plugins that do so will not break MCE views. see #21812, #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22162 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
72ab49062f
commit
063c4c5ae2
@ -325,7 +325,7 @@ window.wp = window.wp || {};
|
||||
// Empty the wrapper, attach the view element to the wrapper,
|
||||
// and add an ending marker to the wrapper to help regexes
|
||||
// scan the HTML string.
|
||||
wrapper.empty().append( view.el ).append('<span data-wp-view-end></span>');
|
||||
wrapper.empty().append( view.el ).append('<span data-wp-view-end class="wp-view-end"></span>');
|
||||
});
|
||||
},
|
||||
|
||||
@ -333,7 +333,7 @@ window.wp = window.wp || {};
|
||||
// Scans an HTML `content` string and replaces any view instances with
|
||||
// their respective text representations.
|
||||
toText: function( content ) {
|
||||
return content.replace( /<(?:div|span)[^>]+data-wp-view="([^"]+)"[^>]*>.*?<span data-wp-view-end[^>]*><\/span><\/(?:div|span)>/g, function( match, id ) {
|
||||
return content.replace( /<(?:div|span)[^>]+data-wp-view="([^"]+)"[^>]*>.*?<span[^>]+data-wp-view-end[^>]*><\/span><\/(?:div|span)>/g, function( match, id ) {
|
||||
var instance = instances[ id ],
|
||||
view;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user