PeekMD v0.2
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-gfmAST 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>, andon*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-wordandmax-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
- Download PeekMD-v0.2.dmg.
- Open the disk image and drag PeekMD into Applications.
- Launch PeekMD to enable instant Spacebar Quick Look previews and Finder right-click Markdown creation.