Skip to content

Issues using a syntax tree with stringify #107

Discussion options

You must be logged in to vote

A couple problems:

  1. unified stringify doesn't run transforms, remark-rehype is a transform, meaning in your example it is trying to turn a markdown tree into HTML text without having converted to an HTML tree. The overall flow is documented at https://github.com/unifiedjs/unified#description, to make this work run is needed to apply the transform.
  2. stringify is not a promise, calling .then will cause an error

see: https://codesandbox.io/s/remark-rehype-debug-forked-4fybi?file=/src/index.js for an example of how this comes together

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cyberwombat
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
🗄 area/interface This affects the public interface
2 participants