2

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" 

});

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

任何想法都会很棒。

4

1 回答 1

2

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

于 2012-07-18T11:19:59.637 回答