question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing markdown transformed by remark plugin

See original GitHub issue

Hello! Thank you for your work on this library!

I have a custom remark plugin that transforms markdown by modifying local image links. I notice the transformation is propagated to document.body.html, but does not appear in document.body.raw. Is it possible to also have a new property available e.g. document.body.markdown which has the transformed markdown string? Or is there another way to get access to it? Thank you so much!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
schicklingcommented, Jul 6, 2022

Thanks for clarifying your use case @sarimabbas. I’m closing this issue for now. In case someone else has this use case feel free to comment.

0reactions
sarimabbascommented, Jul 5, 2022

I think that makes sense @schickling. I think my initial approach was to separate the build time markdown transformations from the runtime transformations. In other words my contentlayer remark plugins would mess about with the filesystem and modify some image links. Then I hoped to send that transformed markdown to my client which would do other stuff like GFM etc.

But I can just put all my remark plugins at the contentlayer level. Alternatively I can run some rehype plugins in my client. No problem 👍

Thank you for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transforming Markdown with Remark & Rehype - ryanfiller.com
Writing custom plugins to give extra powers to Markdown syntax using the Unified ecosystem.
Read more >
remark/plugins.md at main - GitHub
remark is a tool that transforms markdown with plugins. See the monorepo readme for info on what the remark ecosystem is. This page...
Read more >
Creating a Remark Transformer Plugin - Gatsby
gatsby-transformer-remark empowers developers to translate Markdown into HTML to be consumed via Gatsby's GraphQL API. Blogs and other content based sites ...
Read more >
How to build a Remark plugin to supercharge your static site
Remark is a markdown parser built in JavaScript. "Parser" doesn't do Remark justice. Remark is a whole compiler ecosystem built on plugins. It's ......
Read more >
remark - markdown processor powered by plugins
remark is a markdown processor powered by plugins part of the unified collective. The project parses and compiles markdown, and lets programs process ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found