Skip to content

chore: upgrade unified dependencies #1559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 26, 2025
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
10,607 changes: 7,516 additions & 3,091 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@
"@tiptap/extension-underline": "^2.11.5",
"@tiptap/pm": "^2.11.5",
"emoji-mart": "^5.6.0",
"hast-util-from-dom": "^4.2.0",
"hast-util-from-dom": "^5.0.1",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-highlight": "^0.13.0",
"prosemirror-model": "^1.24.1",
"prosemirror-state": "^1.4.3",
"prosemirror-tables": "^1.6.4",
"prosemirror-transform": "^1.10.2",
"prosemirror-view": "^1.38.1",
"rehype-format": "^5.0.0",
"rehype-parse": "^8.0.4",
"rehype-remark": "^9.1.2",
"rehype-stringify": "^9.0.3",
"remark-gfm": "^3.0.1",
"remark-parse": "^10.0.1",
"remark-rehype": "^10.1.0",
"remark-stringify": "^10.0.2",
"unified": "^10.1.2",
"rehype-format": "^5.0.1",
"rehype-parse": "^9.0.1",
"rehype-remark": "^10.0.0",
"rehype-stringify": "^10.0.1",
"remark-gfm": "^4.0.1",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"remark-stringify": "^11.0.0",
"unified": "^11.0.5",
"uuid": "^8.3.2",
"y-prosemirror": "1.2.17",
"y-protocols": "^1.0.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## **Heading ***~~2~~*
## **Heading ***~~2~~*

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I know that it's a unicode space character but it doesn't seem quite right to have in the Markdown

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be done to prevent markdown parsers from trimming text before the space

Paragraph

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
* Bullet List Item 1
* Bullet List Item 2
* Bullet List Item 1

1. Numbered List Item 1
2. Numbered List Item 2
* Bullet List Item 2

* [ ] Check List Item 1
* [x] Check List Item 2
1. Numbered List Item 1

2. Numbered List Item 2

* [ ] Check List Item 1
* [x] Check List Item 2
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
* Bullet List Item 1
* Bullet List Item 1

* Bullet List Item 2
* Bullet List Item 2

1. Numbered List Item 1
1. Numbered List Item 1

2. Numbered List Item 2
2. Numbered List Item 2

* [ ] Check List Item 1
* [x] Check List Item 2
* [ ] Check List Item 1
* [x] Check List Item 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"id": "0",
"type": "paragraph",
"props": {
"textColor": "default",
"backgroundColor": "default",
"textAlignment": "left"
},
"content": [
{
"type": "text",
"text": "hello ",
"styles": {}
},
{
"type": "text",
"text": "beautiful ",
"styles": {
"bold": true
}
},
{
"type": "text",
"text": " world",
"styles": {}
}
],
"children": []
},
{
"id": "2",
"type": "paragraph",
"props": {
"textColor": "default",
"backgroundColor": "default",
"textAlignment": "left"
},
"content": [],
"children": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"id": "1",
"type": "paragraph",
"props": {
"textColor": "default",
"backgroundColor": "default",
"textAlignment": "left"
},
"content": [
{
"type": "text",
"text": "hello **beautiful ** world",
"styles": {}
}
],
"children": []
}
]
5 changes: 5 additions & 0 deletions packages/core/src/api/parsers/markdown/parseMarkdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ P*ara*~~grap~~h
* Bullet List Item`;
await parseMarkdownAndCompareSnapshots(markdown, "complex");
});

it("whitespace bold", async () => {
const markdown = `hello **beautiful ** world`;
await parseMarkdownAndCompareSnapshots(markdown, "whitespace bold");
});
});

describe("Issue 226", () => {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/api/parsers/markdown/parseMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export async function markdownToBlocks<
pmSchema: Schema
): Promise<Block<BSchema, I, S>[]> {
const deps = await initializeESMDependencies();

const htmlString = deps.unified
.unified()
.use(deps.remarkParse.default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ exports[`Test ServerBlockNoteEditor > converts to and from HTML (blocksToHTMLLos
`;

exports[`Test ServerBlockNoteEditor > converts to and from markdown (blocksToMarkdownLossy) 1`] = `
"## **Heading ***~~2~~*
"## **Heading&#x20;***~~2~~*

Paragraph

* list item
* list item

![Example](exampleURL)

Expand All @@ -150,8 +150,10 @@ exports[`Test ServerBlockNoteEditor > converts to and from markdown (blocksToMar
"children": [],
"content": [
{
"styles": {},
"text": "**Heading **",
"styles": {
"bold": true,
},
"text": "Heading ",
"type": "text",
},
{
Expand Down
Loading