Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!