Skip to content

getting the "component props" in markdown #1253

Answered by Elon-Mask12
Elon-Mask12 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry about the late reply been a bit busy lately.
I did a bit of searching using the links you shared, and thanks a ton i managed to find something.
Incase anyones interested:

import { toMdast } from "hast-util-to-mdast";
import { toMarkdown } from "mdast-util-to-markdown";

const getMarkdownFromProps = (props: any) => {
  const mdast = toMdast(props.node);
  const md = toMarkdown(mdast);
  return md;
};

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@ChristianMurphy
Comment options

@Elon-Mask12
Comment options

@ChristianMurphy
Comment options

@Elon-Mask12
Comment options

Answer selected by Elon-Mask12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants