My markdown file has frontmatter and sometimes includes inline URLs that are not properly formatted with markdown syntax. I'm looking for a way to handle these non-markdown URLs within the markdown file - possibly by parsing them into HTML URLs using a regex plugin or similar method. Any tips from experienced front-end developers would be greatly appreciated! 🙏
Example .md file:
---
category: "general"
medium: "forum"
date: "July 25, 2010"
---
For future reference, here's my public key. **http://www.iamyourfather.org/papa.asc**
After processing the markdown with remark and the HTML plugin, the content is converted into an HTML string like so:
// Use gray-matter to parse the quote metadata section
const matterResult = matter(fileContents)
// Use remark to convert markdown into HTML string
const processedContent = await remark()
.use(html)
.process(matterResult.content)
const contentHtml = processedContent.toString()
I want the "contentHtml" string to include clickable HTML links for plaintext URLs found in the markdown content. Is there a way to achieve this using remark, remark-html, and potentially another plugin all at once? Or will I need to take multiple steps to make it work?