Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ function listItemMarker(context: RenderContext): string {
/**
* Markdown items may start with a nested block, but the list-item schema requires a paragraph
* first. Supply that empty paragraph before Yjs hydration can discard the invalid subtree.
* Upstream demotes an opening heading (`- # Title`) to the item's paragraph, dropping its level;
* CommonMark reads it as a heading inside the item, so parse it as a block like any other.
*
* Nested blocks keep the two-space indent under every marker. Upstream aligns ordered-item
* children to the marker width, but its ordered-list tokenizer strips one column less, so a
Expand All @@ -20,7 +22,13 @@ function listItemMarker(context: RenderContext): string {
*/
export const MarkdownListItem = ListItem.extend({
parseMarkdown(token, helpers) {
const parsed = this.parent?.(token, helpers) ?? []
const parsed =
token.type === 'list_item' && token.tokens?.[0]?.type === 'heading'
? {
type: this.name,
content: (helpers.parseBlockChildren ?? helpers.parseChildren)(token.tokens),
}
: (this.parent?.(token, helpers) ?? [])
if (Array.isArray(parsed)) return parsed
const content = (parsed.content ?? []).flatMap(splitBlockImageParagraph)
if (content[0]?.type !== 'paragraph') content.unshift({ type: 'paragraph' })
Expand Down
34 changes: 17 additions & 17 deletions apps/sim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,23 @@
"@t3-oss/env-nextjs": "0.13.11",
"@tanstack/react-query": "5.90.8",
"@tanstack/react-virtual": "3.13.24",
"@tiptap/core": "3.31.4",
"@tiptap/extension-code": "3.31.4",
"@tiptap/extension-code-block": "3.31.4",
"@tiptap/extension-collaboration": "3.31.4",
"@tiptap/extension-collaboration-caret": "3.31.4",
"@tiptap/extension-document": "3.31.4",
"@tiptap/extension-hard-break": "3.31.4",
"@tiptap/extension-image": "3.31.4",
"@tiptap/extension-list": "3.31.4",
"@tiptap/extension-paragraph": "3.31.4",
"@tiptap/extension-placeholder": "3.31.4",
"@tiptap/extension-table": "3.31.4",
"@tiptap/markdown": "3.31.4",
"@tiptap/pm": "3.31.4",
"@tiptap/react": "3.31.4",
"@tiptap/starter-kit": "3.31.4",
"@tiptap/suggestion": "3.31.4",
"@tiptap/core": "3.32.2",
"@tiptap/extension-code": "3.32.2",
"@tiptap/extension-code-block": "3.32.2",
"@tiptap/extension-collaboration": "3.32.2",
"@tiptap/extension-collaboration-caret": "3.32.2",
"@tiptap/extension-document": "3.32.2",
"@tiptap/extension-hard-break": "3.32.2",
"@tiptap/extension-image": "3.32.2",
"@tiptap/extension-list": "3.32.2",
"@tiptap/extension-paragraph": "3.32.2",
"@tiptap/extension-placeholder": "3.32.2",
"@tiptap/extension-table": "3.32.2",
"@tiptap/markdown": "3.32.2",
"@tiptap/pm": "3.32.2",
"@tiptap/react": "3.32.2",
"@tiptap/starter-kit": "3.32.2",
"@tiptap/suggestion": "3.32.2",
"@tiptap/y-tiptap": "3.0.7",
"@trigger.dev/core": "4.8.3",
"@trigger.dev/sdk": "4.8.3",
Expand Down
Loading
Loading