Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
"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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda