views:

815

answers:

2

I have a front page of my site optimized for SEO. I am using tags to mark important content. When I edit my article in admin section with TinyMCE editor, it replaces tags with tags, which I want to avoid.

Any ideas how to make this web editor (TinyMCE) not replace my <strong> tags?

+1  A: 

Check your tinyMCE.init() call and look for the valid_elements option. If it's set to something like:

tinyMCE.init({
    ...
    valid_elements : "..., b/strong, ..."
});

That means it's set to replace strong tags with b tags. Just switch to allowing both ("b, strong", or even replacing b tags with strong tags like

tinyMCE.init({
    ...
    valid_elements : "..., strong/b, ..."
});

See also this page in the documentation.

Dan U.
A: 

While valid_elements should effect strong tag, in practice in doesn't. The solution is to comment out the following code in tiny_mce.js -

/*h=h.replace(/<strong([^>]*)>/gi,'<b$1>');h=h.replace(/<\/strong>/gi,'</b>');*/
PHP thinker