Xavier Oh

Converting markdown to html using remark

Overview

Table of contents

Syntax highlighting

Javascript

import React from "react"
import ReactDOM from "react-dom"
import ReactMarkdown from "react-markdown"
import rehypeHighlight from "rehype-highlight"

ReactDOM.render(
  <ReactMarkdown rehypePlugins={[rehypeHighlight]}>
    {"# Your markdown here"}
  </ReactMarkdown>,
  document.querySelector("#content"),
)

Python

weekdays = ["Sunday", "Monday", "Tuesday","Wednesday", "Thursday","Friday", "Saturday"]
print("Seven Weekdays are:\n")
for day in range(len(weekdays)):
    print(weekdays[day])

GitHub flavored markdown (GFM)

Feature Support
CommonMark 100%
GFM 100% w/ remark-gfm

strikethrough

  • task list
  • checked item

https://example.com