Skip to content

PeekMD v0.2

Choose a tag to compare

@ravindusp ravindusp released this 15 Aug 19:25
· 14 commits to main since this release

PeekMD v0.2 - Next-Generation AST Markdown Engine πŸš€

PeekMD v0.2 introduces a completely overhauled Markdown parser and rendering architecture powered by Apple's official swift-markdown (backed by cmark-gfm), bringing full GitHub-Flavored Markdown compliance, safe raw HTML rendering, token-based syntax highlighting, local LaTeX math typesetting, and enhanced Obsidian callout support to both macOS Quick Look and the standalone PeekMD viewer.


✨ What's New in v0.2

🧠 Full AST Markdown Parser (swift-markdown)

  • Replaced the line-oriented regex parser with Apple's official swift-markdown / cmark-gfm AST parser.
  • Reliable CommonMark & GitHub-Flavored Markdown parsing with accurate AST node traversal.
  • Proper nested list hierarchies, multiline list items with continuation paragraphs, code blocks, and blockquotes.
  • ATX (# H1 .. ###### H6) and Setext (===, ---) headings with auto-generated anchor IDs for document navigation.
  • GFM table alignments (:---, :---:, ---:) with escaped pipe \| support and horizontal scroll wrappers.

πŸ›‘οΈ Safe Raw HTML & GitHub README Compatibility

  • Full support for standard GitHub README HTML markup: <div align="center">, <img width="420">, <details>, <summary>, <kbd>, <mark>, <sub>, <sup>, and raw tables.
  • Built-in HTML sanitization that automatically rejects <script>, <iframe>, <object>, and on* event handlers.
  • HTML comments are automatically hidden/stripped from visible output.

🎨 Single-Pass Tokenized Syntax Highlighting

  • Fixed regex corruption over generated HTML tags by introducing a single-pass, token-based syntax scanner.
  • Source code is tokenized into non-overlapping intervals (keyword, string, comment, number, type, function, property, tag) and escaped exactly once.
  • Zero class="token-string"> text pollution across Swift, TypeScript/JS, JSON, Bash, HTML, C/C++, Rust, Go, Python, SQL, and CSS.

πŸ–ΌοΈ Robust Local Image & Asset Resolution

  • Directory-aware relative path lookup for sibling assets (assets/logo.png), parent paths (../images/img.png), and percent-encoded paths.
  • Local images are automatically embedded as Base64 data:<mime>;base64,... data URIs, enabling sandbox-safe rendering in both Quick Look previews and WebKit views.

πŸ“ Local LaTeX / Math Typesetting

  • Bundled local KaTeX stylesheets and auto-render engine with zero external CDN dependencies.
  • Inline math ($E = mc^2$) and display math blocks ($$\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}$$).
  • Currency values ($50 and $100) are protected from accidental math conversion.

πŸ“‘ Obsidian Callouts & Wikilinks

  • 13 Obsidian callout styles: NOTE, TIP, IMPORTANT, WARNING, CAUTION, INFO, SUCCESS, QUESTION, FAILURE, DANGER, BUG, EXAMPLE, QUOTE.
  • Native foldable callout support: > [!NOTE]+ (expanded by default) and > [!NOTE]- (collapsed by default) using semantic HTML5 <details> and <summary>.
  • Wikilink support: [[Target]], [[Target|Alias]], [[Target#Section]], [[Target#^block]], and image embeds ![[assets/image.png|300]].

πŸ“± Layout Overflow Protection

  • Universal overflow-wrap: break-word and max-width: 100% across all 4 themes (System, GitHub, Minimal, Academic) preventing document-wide horizontal scrollbars.
  • Responsive table containers with dedicated horizontal scrolling.

πŸ“¦ Release Assets & Checksums

File SHA-256 Checksum
PeekMD-v0.2.dmg 628a2b23ad837a254003ef6166a924842c6eb05ded9c3c25be4d4f5f18ef15a4

πŸ› οΈ Installation

  1. Download PeekMD-v0.2.dmg.
  2. Open the disk image and drag PeekMD into Applications.
  3. Launch PeekMD to enable instant Spacebar Quick Look previews and Finder right-click Markdown creation.