gpt4 book ai didi

javascript - 帮助! TinyMCE 正在重新格式化我的代码!

转载 作者:行者123 更新时间:2023-11-28 04:15:19 26 4
gpt4 key购买 nike

当我编辑 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 不能自动关闭——这就是它为您修复它的原因。如果您希望它与您所说的完全一样,那么您需要更改 element_format 属性。

关于javascript - 帮助! TinyMCE 正在重新格式化我的代码!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1588271/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com