Skip to content

Markdown → HTML template → mdast/mdast -> HTML? #157

Answered by wooorm
shawnbot asked this question in Q&A
Discussion options

You must be logged in to vote
  • you have a bug with async visitor — those don‘t work, that might be a problem? Your plugin itself is sync (because it doesn‘t return a promise or accept a callback), but the visitor runs async. So this probably introduces a race condition?
  • I suggest replacing remark-highlight.js with rehype-highlight, as @ChristianMurphy also mentioned. Highlighting lives more in HTML/hast/rehype space than markdown
  • “When I stringify the code node with mdast-util-to-string I lose all of the highlighting [...]” This is not something mdast-util-to-string is for. What mdast-util-to-string does is try to get the text in something (sort of like domNode.innerText or domNode.textContent). There are different pr…

Replies: 3 comments 2 replies

Comment options

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

@wooorm
Comment options

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 ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants