Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Markdown Diff PreviewNew to Visual Studio Code? Get it now.
Markdown Diff Preview

Markdown Diff Preview

xpeng_hans2

|
295 installs
| (0) | Free
Preview rendered Markdown diffs with visual highlighting - compare your changes against Git HEAD
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown Diff Preview

Preview rendered Markdown diffs with visual highlighting - compare your changes against Git HEAD.

Features

Inline View & Side-by-Side View

Switch between two viewing modes to compare Markdown changes:

  • Inline View: Shows old and new versions stacked vertically with character-level highlights
  • Side-by-Side View: Displays old (HEAD) and new (working) versions side by side with synchronized scrolling

Character-Level Diff Highlighting

Instead of marking entire lines as added/removed, this extension highlights the exact characters that changed:

  • Removed characters are shown with red background and strikethrough
  • Added characters are shown with green background
  • The containing line of modified characters has a subtle background tint for context

Context-Aware Rendering

Modified content within tables, code blocks, and Mermaid diagrams is rendered as complete structures with highlights embedded inside - no broken tables or leaked source code.

Git Integration

  • Auto-detects Git diff tabs for .md files
  • One-click button in the editor title bar for Markdown files
  • Auto-refreshes on file save

Usage

  1. Open a .md file that has been modified (tracked by Git)
  2. Click the diff icon in the editor title bar, or run Markdown Diff Preview from the Command Palette (Ctrl+Shift+P)
  3. Use the toolbar buttons to toggle between Inline and Side-by-Side views

Requirements

  • VS Code >= 1.75.0
  • Git extension enabled (built-in vscode.git)

Extension Settings

This extension does not add any VS Code settings currently.

Known Issues

  • Mermaid diagrams are rendered as code blocks (native Mermaid rendering requires additional extensions)

Release Notes

0.2.0

  • Character-level diff highlighting with render-then-diff approach
  • Context-aware table/code block rendering
  • Git Graph integration for .md diff tabs
  • "Unified" view renamed to "Inline" view
  • Fixed source code leak below rendered tables/Mermaid diagrams
  • Fixed side-by-side view incorrectly marking unmodified rows as deleted

0.1.0

  • Initial release with Inline and Side-by-Side diff views
  • Line-level diff highlighting
  • Auto-refresh, scroll sync, and VS Code theme integration

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft