Ticket #12464: 12464.2.diff
File 12464.2.diff, 1.3 KB (added by , 13 years ago) |
---|
-
editor_plugin.dev.js
134 134 id = b.match(/id=['"]([^'"]+)/i); 135 135 cls = b.match(/align=['"]([^'"]+)/i); 136 136 w = b.match(/width=['"]([0-9]+)/); 137 cap = b.match(/caption=[ '"]([^'"]+)/i);137 cap = b.match(/caption=["]([^"]+)/i); 138 138 139 139 id = ( id && id[1] ) ? id[1] : ''; 140 140 cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; 141 141 w = ( w && w[1] ) ? w[1] : ''; 142 142 cap = ( cap && cap[1] ) ? cap[1] : ''; 143 cap = cap.replace(/'|\\'/g, "'"); 143 144 if ( ! w || ! cap ) return c; 144 145 145 146 div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; … … 163 164 164 165 if ( ! w || ! cap ) return c; 165 166 cls = cls.match(/align[^ '"]+/) || 'alignnone'; 166 cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"');167 167 168 cap = cap.replace(/<[^a|\/a]\S[^<>]*>/gi, '').replace(/["]/g, "'"); 169 168 170 return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; 169 171 }); 170 172 }, … … 230 232 }); 231 233 232 234 tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage); 233 })(); 235 })(); 236 No newline at end of file