readmeio / markdown

ReadMe's flavored Markdown parser and React-based rendering engine.
https://rdmd.readme.io
ISC License
33 stars 9 forks source link

enhance(astToPlainText): improved ReadMe block serialization #916

Closed rafegoldberg closed 2 months ago

rafegoldberg commented 2 months ago
📖 PR App 🎫 RM-9982 :octocat: See ReadMe#12167

🧰 Changes

🧬 QA & Testing

Pull down this branch and try running the following snippet. Compare the results to what you see in next. If ReadMe variables show up as plain text in the output, this worked! :tada:

const body = `> 👍 Success
>
> [Vitae](http://www.google.com) *reprehenderit* at aliquid error voluptates eum dignissimos.

variable: <<name>>
glossary: <<glossary:myMadeUpTerm>>
`;

rdmd.astToPlainText(rdmd.hast(body, { strip: ["style"] }), {
  variables: { defaults: [], user: { name: "John Doe" } },
});
rafegoldberg commented 2 months ago

This PR was released!

🚀 Changes included in v6.86.0