Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
"invalid_elements" not working when we have "valid_elements" in Tinymce

I have a scenario in which we have defined valid and invalid elements in Tinymce. Below are the values of these two:

invalid_elements: 'script',
valid_elements: '*[*]',

"invalid_elements" is to prevent JavaScript to be entered. With above settings, Tinymce is not preventing JavaScript but if I remove "valid_elements" then it starts working.

I am not sure if I remove "valid_elements" still Tinymce will allow everything and that's why keeping "valid_element".

Tinymce version: 5.6.2

Related question but not helping in my scenario: Disable Javascript in TinyMCE

Working Fiddle: https://fiddle.tiny.cloud/WRhaab/2

Is there any way by which I can keep "valid_elements" and prevent JavaScript as well?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

valid_elements and invalid_elements are not exclusive options. They can work together but can't contradict each other.

When you are setting valid_elements to '*[*]', it means all elements are allowed. If all elements are valid, scripts are valid too. That's why if you remove the valid_elements option, invalid_elements starts working.

If you are not sure some elements would stay valid if valid_elements: '*[*]' is removed, you can check HTML 5 and HTML 4 specifications since by default TinyMCE allows all elements specified by these standards. You can use the schema option to switch between different standards.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda