1

got an odd issue here with tinyMCE.

What appears to be happening is that we have one or more instances of tinymce for multiple text areas on the page. For this debugging, we removed all but one instance so it is not getting confused with that and the problem is still persisting.

The problem is that when you load the page, configuration gets loaded correctly and I can see it in the debugger when we check verify_html, it is set to false as expected by the configuration. However when you use "edit html source" button, enter some sample data and click update, some tags get stripped out.

We are using the latest tinymce (3.5.8), I diffed what we use vs the one you can download and it is identical.

What I found so far was that when you initialsie tinymce and it comes to line 1964 (after using a js beautifier for debugging), it does this A = A || {}; So in the initial init, we get the correct options object for A. Where all the configuration parameters that we set are as expected and verify_html is set to false. Which in turn sets valid_elements to allow everything.

if (A.verify_html === false) {
            A.valid_elements = "*[*]"

This works fine, however when we enter some html and click update, when we come to this line object A is empty and does not contain any of the options that we set. Which means that some html get parsed out. Has anyone encountered this issue in the past?

I am not very familiar with tinyMCE, so would appreciate some help with this issue, including the stack trace and options configuration, but I am pretty sure it is not related to options as they do not appear to be being picked up at all when it comes to be checking if A exists.

For the stack trace, here is the trace during init:

f.html.Schema (tiny_mce.js:1964)
k.create.initContentBody (tiny_mce.js:9863)
k.create.init (tiny_mce.js:9832)
k.create.render (tiny_mce.js:9666)
a.dom.ScriptLoader.loadScripts.d.length (tiny_mce.js:7221)
c.each (tiny_mce.js:110)
a.dom.ScriptLoader.loadScripts.o (tiny_mce.js:7220)
a.dom.ScriptLoader.loadScripts.d.length (tiny_mce.js:7215)
p (tiny_mce.js:7117)

And stack trace during update to the text

f.html.Schema (tiny_mce.js:1964)
a.html.Serializer (tiny_mce.js:3358)
u (editor_plugin.js:1)
tinymce.create.objectToImg (editor_plugin.js:1)
tinymce.create.init.n.onPreInit.add.n.serializer.addNodeFilter.v (editor_plugin.js:1)
b.html.DomParser.f.parse (tiny_mce.js:3174)
k.create.setContent (tiny_mce.js:10372)
saveContent (source_editor.js:5)
onsubmit (source_editor.htm:33)

init config:

tinyMCE.init({

    mode : "specific_textareas",
    editor_selector : "editorunfiltered",

    dialog_type                       : "modal",

    urlconvertor_callback :         "myURLConvertor",
    setup : function(ed) {
        ed.onPreProcess.add(function(ed, o) {
            if (o.node.nodeName.toLowerCase() == "body")
                o.getInner = true;
        });
    },
    verify_html : false,
    relative_urls : false
});

Code I am trying to submit into tinymce:

<object classid="clsid:D27CDB6E-AAAA-1111-2222-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="391" height="600">
    <param name="movie" value="/imapbuilder/loader.swf" />
    <param name="base" value="/imapbuilder/" />
    <param name="flashvars" value="datasource=ambassadors.xml" />
    <param name="loop" value="false" />
    <param name="menu" value="true" />
    <param name="quality" value="best" />
    <param name="wmode" value="transparent" />
    <param name="bgcolor" value="#ffffff" />
    <param name="allowScriptAccess" value="always" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="/imapbuilder/loader.swf" width="391" height="600">
      <param name="movie" value="/imapbuilder/loader.swf" />
      <param name="base" value="/imapbuilder/" />
      <param name="flashvars" value="datasource=ambassadors.xml" />
      <param name="loop" value="false" />
      <param name="menu" value="true" />
      <param name="quality" value="best" />
      <param name="wmode" value="transparent" />
      <param name="bgcolor" value="#ffffff" />
      <param name="allowScriptAccess" value="always" />
    <!--<![endif]--><!--[if !IE]>-->
    </object>
<!--<![endif]-->
</object>
4

1 回答 1

0

自版本 3.3 起,该参数verify_html不再可用。您将必须使用参数valid_elementsvalid_children定义哪些 html 代码有效,哪些无效。

于 2013-02-04T11:04:03.110 回答