Repository navigation
Add the rich text document model with HTML and Markdown renderers - #2723
Merged
Merged
Conversation
This was referenced Nov 2, 2026
…abbe7b # Conflicts: # src/FluentCMS.Sdk/PublicAPI.Unshipped.txt
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.
Closes #2686
Adds the typed ProseMirror document model to
FluentCMS.Core(RichText/, namespaceFluentCMS.Core.ProseMirror): a parser fromRichText.Json, a canonical serialiser, a validator, HTML and Markdown renderers, and reference extraction that returns entry and media ids with their JSON path. Unknown node and mark types, bad attributes and broken nesting are reported as validation errors with the path, never dropped.FluentCMS.Sdkgains only the contracts plugins need:IRichTextRenderer,IRichTextNodeRenderer(per node type, which is how a plugin renders a typed inline block),IRichTextNodeContext,RichTextRenderOptions(entry and media URL resolvers) andRichTextFormats.RichTextitself is unchanged; the document model stays in Core until a plugin needs it.Choices the spec does not settle:
entryLinkis a mark withentryIdandentryType(a link over selected text),mediais a node withmediaId,alt,title, and a typed inline block isinlineBlockwithblockTypeanddata. Both nodes are allowed between blocks and inside inline content.inlineBlockand by node type for everything else, so it can also replace a built in node. Block type names that equal a node type name are rejected.data-entry-id,fcms:entry/...,fcms:media/...); unresolved inline blocks render asdata-fcms-blockor<!-- fcms-block: name -->.$.content[3].content[1].marks[0], and every occurrence is returned in document order.FluentCMS.Core.RichTextbecause a namespace with that name hides the SDK typeRichTextfor all other Core code.startoutside 0 to 999999999 is a validation error (in the parser and inOrderedListNode), so a list marker never becomes a negative or over long number./,?or#(javascript:,:) are treated as unsafe, and Markdown destinations and titles encode&as&..markdownextension so the**/*.mdlint does not pick them up.Dependencies: none.
RichTextis lossless