Back to projects

Another Markdown Viewer

A client-side Markdown workspace for editing source, checking a rendered preview, recovering a local draft, and exporting a print-ready PDF.

  • Playwright
  • Vitest
  • DOMPurify
  • Marked
  • CodeMirror 6
  • Vite
  • TypeScript
Context
Personal project
Year
2026

01 / OVERVIEW

02 / PROBLEM

I wanted a focused way to make small Markdown edits and inspect the rendered document without losing the original source or requiring an app backend.

03 / RESPONSIBILITY

I built this project independently from the initial product idea through implementation, testing, and deployment. I owned the editor, Markdown rendering, browser storage, file operations, PDF export, and release verification.

04 / WORK

I kept the editor, renderer, recovery, and file actions separate so each part has a clear job and the source stays readable.

  1. Built a browser app with Vite and TypeScript, using CodeMirror 6 for source editing and Marked for GitHub-Flavored Markdown rendering.

  2. Kept raw Markdown as the canonical document state and sanitized rendered HTML with DOMPurify and an explicit URL policy.

  3. Added source ranges to rendered blocks so selecting preview content can take me back to its Markdown source.

  4. Separated automatic local draft recovery from explicit Markdown file downloads, and used browser print styles for PDF export.

  5. Added Vitest and Playwright coverage for Markdown behavior and browser workflows.

05 / RESULT

The v0.1.0 app supports source editing, a sanitized GFM preview, local draft recovery, Markdown file operations, and browser print-to-PDF.

  1. Deployed the v0.1.0 project as a live site at https://md-viewer.384721.xyz/ and kept the source available in a public GitHub repository.

  2. The browser workflow keeps editing, rendering, recovery, and print preparation on the client without a required backend runtime.

  3. The project keeps Markdown as editable text instead of treating the rendered document as the source.

Project Reflection