Some HTML tags are removed...

May 16, 2012 at 9:44 PM

For some reason when I edit using the tincy_mce editor and view HTML source, and put in new HTML 5 tags like placeholder and required they get removed once I updated the page. how can I stop this from happening?

 

May 16, 2012 at 9:49 PM

It is tinyMCE behavior - look for answers at http://www.tinymce.com/

what you are looking for is "extended_valid_elements"

ex. extended_valid_elements:"div[*],span[*],iframe[src|width|height|name|align]" , - you canadd new elements to that list, but as i said you can read about this here: www.tinymce.com

May 17, 2012 at 8:37 PM
razorc wrote:

It is tinyMCE behavior - look for answers at http://www.tinymce.com/

what you are looking for is "extended_valid_elements"

ex. extended_valid_elements:"div[*],span[*],iframe[src|width|height|name|align]" , - you canadd new elements to that list, but as i said you can read about this here: www.tinymce.com

I did this does not work..

 

            extended_valid_elements: "div[*],span[*],iframe[src|width|height|name|align], input[class|width|height|required|name|value|placeholder|type|id]",

 

I hardly know Javascript to understand it..

May 17, 2012 at 8:49 PM

I will give you one example , if you still have the problem with tiny_mce please post questions on www.tinymce.com

let sasy you use html5 tag <article>, you can add it as valid element in tiny_mce like that:

extended_valid_elements: "article[*],div[*],span[*],iframe[src|width|height|name|align]",

as you can see i added article[*], to the list of valid elements , so now tiny_mce will know it is valid tag and will not remove it