[Devlog 2] Latex, GFM, HTML sanitization

Nathan Luong | March 16, 2023 4

Expanding Blogs Functionalities

šŸ‘‰ Support Katex for Math equation inputs (react-katex and the remark-math plugin)

Block Equations:

s=ut+12at2s = ut + \frac{1}{2}at^{2}

Inline Equations:

Calculate the value of ss when u=10msu = 10\frac{m}{s} and a=2ms2a = 2\frac{m}{s^{2}} at t=1st = 1s


šŸ‘‰ Support Github-flavored-Markdown(remarkGfm plugin)

  1. Render Markdown table as HTML Table

    IDBlogs# Views
    114
    29
    310
    45
    5Portfolio devlog 20
  2. Render read-only input-field

  - [x] Implement `gfm`
  - [ ] Post this blog post

šŸ‘‰ Rendered as:

  • Implement gfm
  • Post this blog post.

šŸ‘‰ Support raw HTML rendering (rehype-raw plugin)

  <center>
    <iframe width="560" height="315"
        src="https://www.youtube.com/embed/88Jv7J4yjU4"
        title="YouTube video player" frameborder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
        allowfullscreen>
    </iframe>
  </center>

šŸ‘‰ Rendered as: