Documentation Index
Fetch the complete documentation index at: https://mintlify.com/euclidesseg/euclides-workspace/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheEuclidesEditorSchema defines the structure, rules, and capabilities of documents in the Euclides Rich Editor. It specifies what nodes (block elements) and marks (inline formatting) are available, along with their attributes and HTML serialization rules.
EuclidesEditorSchema
The schema is built by extending ProseMirror’sbasicSchema with custom nodes and marks.
Nodes
Paragraph Node
The paragraph node is extended frombasicSchema with a custom textAlign attribute.
textAlignattribute with default value of'left'- Parses
text-alignCSS property from HTML<p>tags - Serializes to HTML with inline
text-alignstyle
List Nodes
List support is added using ProseMirror’saddListNodes() utility:
ordered_list: Numbered listsbullet_list: Unordered listslist_item: Individual list items
"paragraph block*": Specifies that list items can contain a paragraph followed by any number of block nodes"block": Categorizes list nodes as block-level elements
Other Nodes
Inherited frombasicSchema:
heading: Heading levels 1-6code_block: Code blocksblockquote: Block quoteshorizontal_rule: Horizontal ruleshard_break: Line breakstext: Text content
Marks
Built-in Marks
FrombasicSchema:
strong: Bold text (Ctrl+B)em: Italic text (Ctrl+I)link: Hyperlinks with href attributecode: Inline code
Strike Mark
Custom mark for strikethrough text:- Parses
<s>,<del>tags, andtext-decoration: line-throughCSS - Serializes to
<s>tag - Added to schema with:
basicSchema.spec.marks.addToEnd("strike", strike)
Schema Construction
The schema is built in three steps:-
Update paragraph node: Replace the default paragraph with the custom version
-
Add list nodes: Integrate ordered and unordered lists
-
Add strike mark: Append the strikethrough mark
Source Reference
Location:~/workspace/source/projects/euclides-rich-editor/src/lib/engine/schema/euclides-schema.ts