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

129
Vistas
How to add custom attribute properly in quilljs

I am trying to add some custom attribute using formatText. What I have tried so far:

    var Parchment = Quill.import('parchment');
    var commentAttributor = new Parchment.Attributor.Attribute('comment', 'comment', { 
        scope: Parchment.Scope.INLINE
    });
    Quill.register(commentAttributor, true);

and the delta looks like this:

"ops": [
  {
    "insert": "aa"
  },
  {
    "attributes": {
      "comment": "abc",
      "action": true
    },
    "insert": "aaaaaa"
  },
  {
    "insert": "aaa"
  },
  {
    "attributes": {
      "storyblock": true
    },
    "insert": "\n"
  },
  {
    "insert": "\n"
  }
]

However, when I restored the data from delta, the attribute is gone... what am i doing wrong here?

about 4 years ago · Juan Pablo Isaza
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