Repository navigation
Conversation
…m is raw HTML The markdown parser wrapped the first line of each list item in a `<p>`, also a line that starts a block of raw HTML (for example `1. <details>`). A block element in a `<p>` is not valid HTML: the HTML parser closes the `<p>` before the tag, and makes an empty `<p>` from the end tag `</p>`. In `1. <details>`, that empty `<p>` went into the `<details>` element, and the parse gave the list item a child paragraph that the text does not have. Now such a line is a block of raw HTML, as at the top level, together with the child lines that continue it. A blank line after it ends the block. The parse snapshots of `- [ ] <details>` and `1. <details>` change: the list item has no empty child paragraph. The result of `1. <details>` with a summary and a body does not change.
Markdown has no syntax for an empty paragraph. The export wrote it as a blank line, and the parse dropped it: the paragraphs "Before", empty, "After" came back as two paragraphs. Now the export writes an empty paragraph as the HTML tag `<p></p>` on its own line, also for a child paragraph of a list item (with the indent of the item). The markdown parser gives this line to the HTML parser as a block of raw HTML. The HTML parse of a paragraph rejected each `<p>` without text, so that a `<p>` that only wraps an image is the image (#798). It now reads a `<p>` without any child node as an empty paragraph. A `<p>` with only white space, only a `<br>`, or only an image gives the same blocks as before. Thus pasted HTML with `<p></p>` now gives an empty paragraph. The list item parse leaves out such a `<p>` at the start of an `li`: it is the empty text of the item, and the content after it stays the text of the item, as before (`listItemEmptyParagraphBeforeContent`). The markdown export snapshots of `paragraph/empty` and `paragraph/emptyBetween` change to `<p></p>`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Comment on lines
+1183
to
+1188
| const childContent = subLines | ||
| .join("\n") | ||
| .replace( | ||
| isHtmlBlockStart(firstLineContent) ? /\n+$/ : /^\n+|\n+$/g, | ||
| "", | ||
| ); |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
YousefED
added a commit
that referenced
this pull request
Dec 3, 2026
33 lens tests fail since the merge of main. Each one is now a known failure (it.fails) with a comment that names its cause: - 11 tests: the markdown of main loses an empty paragraph (pull request #3450 repairs it). - 1 test: the markdown of main loses an empty list item. - 1 test: the markdown export of main writes a URL in text without the escape, and the parse makes it a link. - 20 tests (random seeds): an HTML text without blocks gives no block (#3400), and the editor keeps one empty paragraph. The tests themselves do not change. The random tests now run the code of a seed in a function, so that the known seeds can run as known failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
YousefED
added a commit
that referenced
this pull request
Dec 3, 2026
…eries The file tested the markdown fixes of this branch. Since the merge of main, the markdown code is the code of main, with its own tests and pull requests. 451 of the 594 cases of this file fail on that code. The behaviors that the lens needs and main does not have are recorded apart: an empty paragraph (pull request #3450), an empty list item, and a URL in text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 4 tasks
This branch was successfully deployed
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.
Summary
An empty paragraph now survives the markdown round trip in
@blocknote/core. The export writes it as a<p></p>line, and the HTML parse reads a<p>without content as an empty paragraph.Rationale
Markdown has no syntax for an empty paragraph. The export wrote a blank line, which the parse dropped (#1935). #2931 fixed this for HTML.
Changes
<p></p>, also in a list item.<p>without child nodes. A<p>with only white space, a<br>or an image parses as before.<p>at the start of a list item stays the empty text of the item.<p>.Impact
Pasted HTML with a fully empty
<p></p>now gives an empty paragraph. Two parse snapshots of<details>in a list item lose an empty child paragraph.Testing
New tests fail on
mainand pass. Browser tests pass in Chromium, Firefox and WebKit.