WordPress 2.1.1 breaks embed tag

If you are having a post with YouTube video embedded, you must find there is an annoy problem with the latest WordPress 2.1.1. The WordPress 2.1.1 is using TinyMCE 2.0.8, the editor breaks the video. It convert <embed> to <ibed> by mistake.

Actually, the latest TinyMCE 2.1.0 which is releasd at Feb 13 fixed the issue. We can apply the patch for fixing the problem.

--- wp-includes/js/tinymce/tiny_mce.js  (revision 84)
+++ wp-includes/js/tinymce/tiny_mce.js  (local)
@@ -5099,9 +5099,10 @@        // Convert all strong/em to b/i in Gecko
        if (tinyMCE.isGecko) {
-               h = h.replace(/<strong/gi, '<b');
-               h = h.replace(/<em(/?)/gi, '<i');
-               h = h.replace(/<em /gi, '<i');
+               h = h.replace(/<embed([^>]*)>/gi, '<tmpembed$1>');
+               h = h.replace(/<em([^>]*)>/gi, '<i$1>');
+               h = h.replace(/<tmpembed([^>]*)>/gi, '<embed$1>');
+               h = h.replace(/<strong([^>]*)>/gi, '<b$1>');
                h = h.replace(/</strong>/gi, '</b>');
                h = h.replace(/</em>/gi, '</i>');
        }
February 27th, 2007 at 10:00 pm


One Response to “WordPress 2.1.1 breaks embed tag”

  1. Malas Palabras » Cómo poner videos de YouTube en Wordpress Says:

    [...] de Wordpress 2.1 o superiores. Los temerosos pueden modificar el archivo a mano como se explica aquí. Úselo bajo su propio riesgo. Ante cualquier duda consulte a su [...]

Leave a Reply