Add Notion-like WYSIWYG editor for Markdown snippets#8
Merged
Conversation
Markdown snippets can now render as a friendly, Notion-style document instead of source code. A toggle button sits next to the format/copy controls in the editor toolbar (Markdown snippets only) to switch between the rendered preview and the raw source. The default side is controlled by a new "Markdown preview" preference (on by default) in the Preferences dialog, persisted in localStorage. - preferences: add markdownPreviewByDefault (default true) - MarkdownPreview: lazy-loaded react-markdown + remark-gfm renderer, themed Notion-style, kept out of the main bundle - SnippetEditor: preview/source toggle + conditional render; breadcrumbs and aside untouched - i18n: en/es strings for the toggle and preference Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018oYBHxerqBaL63TVZPKGy8
Replace the read-only Markdown preview with a TipTap WYSIWYG editor so Markdown snippets can be written and edited inline (not just read), with a Notion-style experience: a floating selection toolbar, Markdown input shortcuts, task lists, and a clean document layout. Fenced code blocks are syntax highlighted via lowlight (highlight.js) using a VS Code palette. Edits serialize back to Markdown (tiptap-markdown) so the snippet stays a plain .md document; the toggle still flips between this rich view and the raw source CodeMirror. Breadcrumbs and aside are untouched. The "Markdown rich editor" preference now defaults to OFF (snippets open in source view unless the user opts in). - preferences: markdownPreviewByDefault now defaults to false - MarkdownEditor/MarkdownEditorInner: lazy-loaded TipTap editor, kept out of the main bundle; read-only when the snippet is trashed - globals.css: Notion-like document styling + highlight.js token colors (dark + light) - drop react-markdown/remark-gfm in favour of the editable editor - i18n: updated en/es strings for the toggle, placeholder and preference Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018oYBHxerqBaL63TVZPKGy8
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
klipcode | 2226678 | Commit Preview URL Branch Preview URL |
Jun 26 2026, 09:45 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a rich text editing experience for Markdown snippets alongside the existing source code editor. Users can now toggle between a Notion-style WYSIWYG preview and the raw Markdown source, with a preference setting to choose the default view.
Key Changes
New MarkdownEditor component (
MarkdownEditorInner.tsx): A TipTap-based WYSIWYG editor with:Editor styling (
globals.css): Comprehensive.klipcode-mdstyles for document typography, including:SnippetEditor integration:
User preferences: New
markdownPreviewByDefaultsetting in PreferencesDialog to control initial view mode for Markdown snippetsLocalization: Added English and Spanish strings for preview toggle labels and placeholder text
Code splitting: MarkdownEditor uses lazy loading with Suspense to defer TipTap/ProseMirror bundle until needed
Implementation Details
tiptap-markdownto serialize edits back to Markdown, keeping snippets as plain.mdfilescommonbundlecopyprophttps://claude.ai/code/session_018oYBHxerqBaL63TVZPKGy8