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

148
Vistas
How do I define custom renderers for default Markdown elements using markdoc.io?

The React documentation on markdoc.io explains how to use the custom Callout and it works really well :)

If I transform it like this:

  Markdoc.transform(node, {
    tags: {
      callout: {
        render: "Callout",
      },
    },
  });

and render it like this:

 Markdoc.renderers.react(props.content, React, {
    components: {
      Callout: Callout,
    },
  });

If write

{% callout %}
Attention, over here!
{% /callout %}

It works.

The problem is that, I'm trying to use the exact same concept but write

# This is a title

I cannot make it to render my custom React component. It just always renders an h1 HTML tag.

Any idea?

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

0

To override the behavior of a built-in document node, you need to define a custom node schema.

This is an example that demonstrates how to make a heading render with a React component called Heading:

 Markdoc.transform(doc, {
  nodes: {
    heading: {
      render: 'Heading',
    },
  },
});
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