TinyMCE is making my code valid, and I want it to stop! (<img> tag wrapped in <p>)
Posted
by hookedonwinter
on Stack Overflow
See other posts from Stack Overflow
or by hookedonwinter
Published on 2009-11-03T03:28:53Z
Indexed on
2010/04/29
8:27 UTC
Read the original article
Hit count: 175
I have TinyMCE installed on the back end of a site. Some of the html it's accessing isn't totally valid, which I realize is the problem in itself. However, TinyMCE is messing things up by making things valid. I have an <img>
with no parents (no <p>
, no <div>
, etc), and TinyMCE is wrapping the <img>
in <p></p>
. I'm trying to find a setting that will stop that from happening.
Essentially, I want TinyMCE to allow <img>
to be it's own element, rather than a child element, if that makes sense. My current settings are:
tinyMCE.init({
theme : "advanced",
mode : "textareas",
relative_urls : false
});
© Stack Overflow or respective owner