TinyMCE disable escaping

2020-02-14 04:01发布

问题:

I'm using tinyMCE to edit content from an existing website. This website has links in the format:

http://localhost/start.jsp%3Fparam=value

where the %3F is the escaped string for the question mark character. When TinyMCE edits a page containing one of these links, it converts the "%" sign into "%25" which breaks the link.

How can I disable tinyMCE's escaping of percent signs?

I have the following configuration set:

tinyMCE.init({
     mode: "specific_textareas",
     editor_encoding: "raw",
     editor_selector: "tinyMCE",
     relative_urls : false,
     convert_urls : false
}

Note: I am using setContent to populate the initial value of the tinyMCE editor.

回答1:

Should be:

entity_encoding: "raw"

instead of:

editor_encoding: "raw"

See http://tinymce.moxiecode.com/wiki.php/Configuration