gpt4 book ai didi

javascript - TinyMCE 剥离跨度

转载 作者:行者123 更新时间:2023-11-29 22:22:35 25 4
gpt4 key购买 nike

TinyMCE 使用以下配置剥离跨度:

tinyMCE.init({
mode : "specific_textareas",
theme_advanced_resizing_min_width : 550,
editor_selector : /(tiny_mce|image_mce)/,
theme : "advanced",
editor_deselector : "mceNoEditor",
body_class : "cms",
content_css : "/css/content.css",
plugins : "safari, inlinepopups, paste, table",
file_browser_callback : "tinyBrowser",
width : 640,
height : 500,
paste_auto_cleanup_on_paste : true,
theme_advanced_buttons1 : "bold, italic, underline, justifyleft,justifycenter, justifyright, justifyfull , formatselect, |, pasteword ,pastetext, code ",
theme_advanced_buttons2 : "undo,redo,|,bullist, numlist,| , outdent,indent, |, link, unlink, image, forecolor",
theme_advanced_buttons3 : "tablecontrols",
theme_advanced_resizing : true,
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
theme_advanced_statusbar_location : "bottom",
theme_advanced_blockformats : "p,h2,h4",
convert_urls : false,
verify_html : true,
valid_elements : "@[class|style|title],br,h2,h3,h4,-p[align],-strong/b,a[name|href|target]," +
"img[src|border=0|alt|width|height|align],hr[width|size|noshade],-em/i,-span" +
"table[border|cellspacing|cellpadding|width],tr[rowspan],td[colspan],th[colspan],-ul,-ol,-li"

});

有问题的跨度是使用“forecolor”按钮创建的,看起来像这样 <span style="color: rgb(0, 255, 0); ">foo</span> .

任何想法都会很棒。

最佳答案

我创建了一个 tinymce fiddle 来演示这个问题 - 它就在那里。我稍微调整了 valid_elements。现在可以了。在这里查看 tinymce fiddle :http://fiddle.tinymce.com/RNbaab/10

关于javascript - TinyMCE 剥离跨度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11539210/

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