Even though I've specifically instructed it not to, TinyMCE insists on removing any HTML code

I'm encountering difficulties with TinyMCE and custom tags in our custom CMS setup. Here are my current settings:

 tinyMCE.init({
        // General options
        mode: "textareas",
        width: "200",
        theme: "advanced",
        cleanup_on_startup: false,
        trim_span_elements: false,
        verify_html: false,
        cleanup: false,
        convert_urls: false,
...

On one of the pages, I need to include this tag using the source editor:

 <gcse:searchresults-only queryParameterName="search"></gcse:searchresults-only>

However, the editor keeps stripping it out. I attempted adding these rules:

extended_valid_elements: "gcse:searchresults-only[*]",
custom_elements: "gcse:searchresults-only"

This allowed me to add the tag but only if it's not nested within another tag. If I enclose the tag in a div element, TinyMCE strips out the gcse tag, leaving the div empty.

My question is: How can I prevent TinyMCE from stripping out ANY of the tags?

Thank you.

Answer №1

Unfortunately, the option to disable tinymce cleanup has not been available since the release of version 3.4. Instead, you must configure valid_elements and valid_children based on your specific requirements.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Catalog indexed in a JSON document

I'm currently facing an issue with extracting data from a JSON file and populating a list with that information. HTML : <ol id="dataT"> </ol> JavaScript : function GetData(index) { var xhttp = new XMLHttpRequest(); xhttp.onre ...

What is the best method for initializing a grid combo box value using JavaScript?

How do I set the value of a combobox in a grid itemtemplate using JavaScript? <telerik:GridTemplateColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="FAULT" FilterControlWidth="100%" ...

Innovative guidelines originating from a resource attribute

I am facing a challenge with a repeater for a resource that has an attribute containing angular directives mixed with text. My goal is to display form inputs dynamically based on the object's property. <ul> <li ng-repeat="action in actions ...

Adjust the size of three panels (left, middle, right) using Javascript, ensuring that the middle panel remains unchanged in size

I am a newcomer to JavaScript and currently working with HTML, CSS, and JS files. I have three panels - left, center, and right - that I want to resize. The left panel resizes correctly when dragging the column border. https://i.stack.imgur.com/LxhUX.png ...

What is the most efficient way to extract dynamically generated JavaScript content from a webpage?

Currently, my method involves using selenium alongside PhantomJS to scrape dynamic content generated by JavaScript on a website. Although it provides me with the desired results, the process is quite slow as I have to wait for the entire page to load befor ...

How can I access the parameter value for the tooltip callback function within echarts?

I am attempting to retrieve the value for this specific Apache EChart from within the callback function of the tooltip formatter. When I manually input the value, the formatting function operates correctly: formatter: (params:any) => `$ ${Math.round(pa ...

What could be causing the issue with clicking on children of jstree not working?

I am encountering an issue with jstree. Once the data is changed, the click event does not work for every subsequent click. I find that I need to refresh the page in order to make it work. Here is a link to the jsfiddle: http://jsfiddle.net/2Jg3B/2121/ I ...

Creating multiple div elements with changing content dynamically

I am facing an issue with a div named 'red' on my website where user messages overflow the 40px length of the div. To prevent this, I want to duplicate the 'red' div every time a message is sent so that the messages stay within the boun ...

What are the steps to creating an API for a web application?

I have been tasked with creating an API for my web application that will utilize another website's authentication system. While I have a basic understanding of JavaScript, PHP, and HTML, I need guidance on how to proceed with building the API. Here i ...

What is the best way to determine the final letter of a column in a Google Sheet, starting from the first letter and using a set of

My current approach involves generating a single letter, but my code breaks if there is a large amount of data and it exceeds column Z. Here is the working code that will produce a, d: const countData = [1, 2, 3, 4].length; const initialLetter = 'A&a ...

Syncing data between parent and child components in VueJS using v-bind:sync with an object parameter for bidirectional data flow

In the app I am developing, there is a main component that passes an Object, specifically this.form, to a child form component using v-bind:sync="form". The child form then emits values for each key of the parent object on @input events. My goal is to be ...

What is the quickest method to perform a comprehensive comparison of arrays and combine distinct objects?

I am currently working with NextJS and Zustand and I have a state in Zustand that consists of an array of objects: [{a:1, b:2}, {a:2, b:3}] Additionally, there is another incoming array of objects that contains some of the existing objects as well as new ...

Issue with GTM: The use of this language feature is restricted to ECMASCRIPT_2015 mode or higher: constant declaration

I'm having trouble extracting UTMs and transferring them to specific fields through my script, but it seems like the script isn't functioning properly on GTM. (Interestingly, the script does work when directly added to webflow custom code) var ...

Implementing a way to output a JavaScript script using PHP via AJAX

I need help with a JavaScript script that should be echoed when a certain condition is met. The issue arises when the file containing this script is called through Ajax by another page, as it fails to echo the <script>...</script> part. It seem ...

Utilize a Fancybox hyperlink for every image within the specified div container

I'm looking for a solution to automatically add a fancybox link to every image within the div #artikel. Essentially, I want to convert each <img src="image.png"></img> to <a href="image.png" class="fancybox" rel="artikel"><img ...

"Error message: The function is not defined in Firefox, IE, and

DoRowApp function works in Chrome, but is not defined in FF, IE, and Opera. function DoRowApp(id) { document.getElementById('ANSWER.TTQ.MENSYS.1.').value = id; document.getElementById('ANSWER.TTQ.MENSYS.2.').click(); return true;} Thi ...

The signup process is experiencing the unusual occurrence of the Catch block being executed before the

I've encountered an issue where the catch block in my signup process is being triggered before the try block. Upon signing up, the error message from the catch block appears before the success message, which is not the expected behavior. Ideally, I wo ...

Tutorial on how to update a specific value in an array of objects using setState on click event

I need to toggle the active class on click, setting it to a local state and changing all other objects in the state to inactive. const [jobType, setJobType] = useState([ { "class": "active", "type& ...

Utilizing jQuery UI to dynamically alter CSS classes

I'm currently working on a project and could use some assistance. I have divs that are droppable using jQuery UI. While everything is functioning properly and I can drag and drop, I am looking to modify the opacity of the div I am dragging by changing ...

Display a div based on search results

I recently encountered an issue with a script that needs modification to display different divs based on search criteria. Originally, I used this script for a contact list but now need it to perform another function. View the original code (JSFiddle) Here ...