当我从以下位置编辑HTML源代码时:
<div />
结果总是这样:
<div></div>
我不想那样。。它应该把我的代码放在一边;)
配置如下:
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:*[*]",
});
有什么想法吗?
最佳答案
您指定的格式为xhtml
,div
s不能自关闭——这就是为什么它会为您修复。如果您希望它与您所说的完全一致,则需要更改element_format
属性。