1

when i edit the HTML source from:

<div /> 

the result is always something like:

<div></div> 

i don't want that.. it should leave my code alone ;)

here is the config:

tinyMCE.init({ // General options mode : "textareas", theme: "advanced", element_format : "xhtml", remove_linebreaks: false, remove_redundant_brs: false, cleanup_on_startup : false, cleanup: false, // cleanup: true -> custom_elemts are not working... verify_html : false, forced_root_block: false, apply_source_formatting: false, fix_nesting: false, fix_table_elements: false, fix_list_elements : false, fix_content_duplication : false, preformatted : false, extended_valid_elements: "pbo:*[*]", }); 

any ideas?

1
  • The stuff mentioned above is just an example.. this happens to all the other elements too... with the element_format = xhtml TinyMCE produces strange behaviours... Commented Oct 20, 2009 at 7:22

2 Answers 2

6

You're specifying the format as xhtml and divs cannot be self-closing -- that's why it's fixing it for you. If you want it to be exactly as you say then you'll need to change the element_format property.

Sign up to request clarification or add additional context in comments.

2 Comments

<div /> is valid in XHTML. You shouldn't use it because it messes up in IE.
@Tim: [citation needed] :), <div /> is definitely valid XML, but everything I've ever come across says divs are not self-closing elements. script is another good example. I could be wrong on this, for sure. However, as you pointed, out IE explodes when given self-closing divs, so the answer still remains -- stay away :)
3

You really really don't want <div /> tags. They are not valid HTML (and IE always parses documents as HTML) and will break DOM traversal methods in IE.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.