Add prosemirror pkg to handle conversion from and to other formats#940
Draft
codenem wants to merge 10 commits intoepic/rich-editorfrom
Draft
Add prosemirror pkg to handle conversion from and to other formats#940codenem wants to merge 10 commits intoepic/rich-editorfrom
codenem wants to merge 10 commits intoepic/rich-editorfrom
Conversation
f7ccafc to
4008791
Compare
Signed-off-by: Émile Ré <emile@getprobo.com>
4008791 to
7fe271b
Compare
Signed-off-by: Émile Ré <emile@getprobo.com>
Signed-off-by: Émile Ré <emile@getprobo.com>
Signed-off-by: Émile Ré <emile@getprobo.com>
Signed-off-by: Émile Ré <emile@getprobo.com>
Signed-off-by: Émile Ré <emile@getprobo.com>
gearnode
reviewed
Mar 27, 2026
| DocumentData struct { | ||
| Title string | ||
| Content string | ||
| Content string // ProseMirror/Tiptap document JSON; use ProseMirrorJSONToHTML for HTML |
Signed-off-by: Émile Ré <emile@getprobo.com>
Signed-off-by: Émile Ré <emile@getprobo.com>
4a2b4d2 to
090fb11
Compare
Signed-off-by: Émile Ré <emile@getprobo.com>
Signed-off-by: Émile Ré <emile@getprobo.com>
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.
TODO
Summary by cubic
Add
pkg/prosemirrorto parse ProseMirror/Tiptap JSON and render safe HTML for PDFs. Add a Markdown→ProseMirror converter and CLI tools for content migration; enable h1–h6 in the editor; switchpkg/docgento ProseMirror, and fix unwanted PDF page breaks.New Features
pkg/prosemirror:Node/Markstructs andRenderHTML(Node)that escapes HTML and addslanguage-*on code blocks. Supports paragraphs, headings (h1–h6), blockquote, horizontal rules, hard breaks, images, bullet/ordered lists, and tables (cells/headers withcolspan/rowspan;colwidth→min-width). Marks: bold, italic, underline, strike, code, link (href/target/rel/class/title).ParseMarkdown([]byte)builds ProseMirror JSON usinggithub.com/yuin/goldmarkfor consistent lists, tables, code, and inline marks.proboctl md-to-prosemirror(stdin → JSON),probo documentversion update-contentto push JSON via the API, andmigrate-document-versions-markdownto rewritedocument_versions.contentfrom Markdown to ProseMirror JSON.contrib/claude/go-style.mdand linked it fromAGENTS.md.Refactors
pkg/docgen: render from ProseMirror JSON → HTML; template now uses.BodyHTML, styles blockquotes, and removes H2-based page-break CSS. On parse/render failure, fallback to a single escaped<p>with the raw input. Tests updated to expect ProseMirror HTML structure.go.abhg.dev/goldmark/mermaid; upgradedgithub.com/yuin/goldmarktov1.8.2and use it only in the Markdown→ProseMirror converter.Written for commit 3815eec. Summary will update on new commits.