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

80
Vistas
Custom tags in TinyMCE WYSWYG

I have an application which help our user to format the email template. A sample email template looks like this:

Dear <FirstName> <LastName>:    

Thank you for your entry <Title> and your order number is <OrderID>....

These are saved in our database as Text. The issue is when i try to load this text in simple Textarea it works fine when i try to display this text in TinyMCE editor textarea it cuts off when it see the first "<" and display something like this:

Dear :    

Thank you for your entry and your order number is .... 

TinyMCE dose not render the tags. i dont know how to render the custom tags and they are not <abc> </abc> tags. Our system will replace the "<SomeValue>" with the actual value based on the tag and send the email to the client.

I tried replacing the "<" and ">" to "&lt;" and "&gt;" and its not working. I also tried them replacing it to "<code>&lt;" and "&gt;</code>" before i bind the textarea but that is not working either. I have added "code" plugin while declaring my TinyMCE in javascript. Do i need anything else, any specially "entity_encoding"? I tried "raw" and "html" nothings works. here is my javascript

 <script>
        tinymce.init({
            selector: '#mytextarea',
           
            entity_encoding: "html",
            plugins: "code",
            toolbar: 'code'
        });
    </script>

Any help is appreciated as i have spend two days searching the web and trying bunch of things.

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

0

If you want TinyMCE to treat these elements like HTML tags you need to define them as custom tags:

https://www.tiny.cloud/docs/configure/content-filtering/#custom_elements

An alternative which may take less effort to setup is to use another syntax (e.g. {first_name}) along with marking that text as non-editable so that TinyMCE treats the entire string like one "character" in the UI.

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