Repository navigation
Conversation
…lines
## Description
The experimental HTML importer turns `<pre><div>alpha</div><div>beta</div></pre>` into a CodeNode with two ParagraphNode children. Its text becomes `alpha\n\nbeta`, and the nested paragraphs do not match the flat code-line structure used by code editing and highlighting.
Normalize ordinary imported paragraphs into their existing inline children with explicit line breaks between lines. This preserves leading, consecutive and trailing empty paragraphs. Apply the same normalization at the PRE, multiline CODE, monospace DIV and GitHub code-table import boundaries.
The change is intentionally limited to runs of inline nodes and built-in paragraphs containing inline nodes. Runs containing other block structures or custom paragraph implementations retain their existing behavior. There are no new public APIs or dependencies, and the legacy importer is unchanged.
## Test plan
### Before
On unchanged `30772fe845a6fbd0efbd242bea9c3d701ea9e614`, with the new regression tests:
```sh
./node_modules/.bin/vitest --project unit --run packages/lexical-code-core/src/__tests__/unit/CodeParagraphImport.test.ts
```
```text
Test Files 1 failed (1)
Tests 15 failed | 6 passed (21)
```
### After
The same command with this change:
```text
Test Files 1 passed (1)
Tests 21 passed (21)
```
The tests cover the four import boundaries, empty lines, mixed inline/paragraph content, nested transparent HTML wrappers, tabs, and preservation of existing code/table/custom node objects.
```sh
./node_modules/.bin/vitest --project unit --run \
packages/lexical-html/src/__tests__/unit \
packages/lexical-code-core/src/__tests__/unit \
packages/lexical-code-prism/src/__tests__/unit \
packages/lexical-code-shiki/src/__tests__/unit \
packages/lexical-clipboard/src/__tests__/unit
```
```text
Test Files 35 passed (35)
Tests 419 passed (419)
```
Also passed:
```sh
./node_modules/.bin/eslint packages/lexical-code-core/src/CodeImportExtension.ts packages/lexical-code-core/src/__tests__/unit/CodeParagraphImport.test.ts
./node_modules/.bin/prettier --check packages/lexical-code-core/src/CodeImportExtension.ts packages/lexical-code-core/src/__tests__/unit/CodeParagraphImport.test.ts
./node_modules/.bin/tsc -p tsconfig.test.json --noEmit
git diff --check
```
Local validation used macOS arm64 and Node 26.7.0. The full monorepo, Windows and Linux matrices were not run locally.
Implemented with Codex assistance.
maximilliangrand
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
September 29, 2026 11:58
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
reviewed
Sep 30, 2026
| child => | ||
| $isBlockLevel(child) && | ||
| (!$isParagraphNode(child) || | ||
| child.constructor !== ParagraphNode || |
Collaborator
There was a problem hiding this comment.
This is just nonsense, !$isParagraphNode(child) already covers every case of child.constructor !== ParagraphNode, but the child.constructor comparison is worse because it doesn't support subclasses or node replacement.
Comment on lines
+37
to
+39
| function $flattenCodeParagraphs(children: LexicalNode[]): LexicalNode[] { | ||
| // Other block nodes can have their own separators or custom semantics. | ||
| // Only normalize runs of inlines and ordinary paragraphs of inlines. |
Collaborator
There was a problem hiding this comment.
If the goal here is to normalize to exactly the constructs that CodeNode supports then it should do that, rather than handling only ParagraphNode.
## Description Paragraph-only normalization can leave headings, links, nested code and custom blocks inside imported CodeNodes. Normalize each imported node's plain-text representation through the existing code tokenizer so all six import paths produce CodeHighlightNode, TabNode and LineBreakNode children. Preserve custom getTextContent implementations, add one line break at top-level block boundaries, and let nested containers retain their own text separators. Plain monospace DIV descendants retain their block boundaries. ## Test plan ### Before With the updated unit tests on 0beca6a: ```sh ./node_modules/.bin/vitest --project unit --run packages/lexical-code-core/src/__tests__/unit/CodeContentImport.test.ts ``` ```text Test Files 1 failed (1) Tests 28 failed | 3 passed (31) ``` ```sh VITEST_BROWSER=chromium,firefox,webkit ./node_modules/.bin/vitest run --project browser packages/lexical-code-core/src/__tests__/browser/CodeContentImport.test.ts ``` ```text Test Files 3 failed (3) Tests 3 failed (3) ``` ### After The same unit and browser commands: ```text Test Files 1 passed (1) Tests 31 passed (31) ``` ```text Test Files 3 passed (3) Tests 3 passed (3) ``` All 948 affected unit tests and 339 source tree-shaking tests pass. Source/test TypeScript checks, changed-file ESLint/Prettier and git diff --check pass. Browser tests dispatch native synthetic paste events to a mounted contenteditable in Chromium, Firefox and WebKit on macOS. The full playground end-to-end matrix was not run locally.
maximilliangrand
added a commit
to maximilliangrand/lexical
that referenced
this pull request
Sep 30, 2026
…ion HTML import ## Description The experimental HTML importer drops empty transparent blocks such as `<div><br></div>`. In the Gmail reproduction from meta#4830, pasting yields nine paragraphs instead of eleven. Preserve those authored blank boundaries at the root and in table cells, list items, and code content. The default BR rule retains a sole placeholder only within its owning transparent block. A custom rule that discards the BR, including middleware that discards `$next()`'s result, remains authoritative. List segments are joined by position so a leading empty segment retains its separator. Code imports use the normalization in meta#9272, including when a blank appears beside nested code or a custom paragraph replacement. This follow-up changes two production files and adds regression coverage; it adds no public API. Related to meta#4830 (thanks to @djheyson for the reproduction). meta#9271 addresses the default importer separately. Developed with Codex assistance. ## Test plan ### Before Copied the final unit and browser tests onto the prerequisite at `a6328b61bbb00dabf3d894dfba63ef9754275f0f`: ```sh ./node_modules/.bin/vitest --project unit --run packages/lexical-html/src/__tests__/unit/EmptyBlockImportExtension.test.ts packages/lexical-html/src/__tests__/unit/EmptyBlockImportOverrides.test.ts ``` ```text Test Files 2 failed (2) Tests 28 failed | 5 passed (33) ``` ```sh VITEST_BROWSER=chromium,firefox,webkit ./node_modules/.bin/vitest run --project browser packages/lexical-html/src/__tests__/browser/EmptyBlockImportExtension.test.ts ``` ```text Test Files 3 failed (3) Tests 3 failed (3) ``` ### After The same unit command: ```text Test Files 2 passed (2) Tests 33 passed (33) ``` Gmail paste and the prerequisite's code-paste regression together in all three engines: ```sh VITEST_BROWSER=chromium,firefox,webkit ./node_modules/.bin/vitest run --project browser packages/lexical-code-core/src/__tests__/browser/CodeContentImport.test.ts packages/lexical-html/src/__tests__/browser/EmptyBlockImportExtension.test.ts ``` ```text Test Files 6 passed (6) Tests 6 passed (6) ``` All 981 affected tests pass across HTML, code-core, code-prism, code-shiki, list, table, rich-text, and clipboard. Test TypeScript, Flow (zero errors), changed-file ESLint/Prettier, and `git diff --check` pass. Coverage includes leading/consecutive/trailing blanks, nested transparent blocks, table cells, list segments, all ordinary code import paths, exact blank-line counts beside nested code, custom deletion/replacement rules, paragraph replacements, and Gmail formatting/link preservation. Browser checks use native synthetic clipboard events dispatched to mounted contenteditables in Chromium, Firefox, and WebKit on macOS. The full playground end-to-end matrix was not run locally.
etrepum
approved these changes
Sep 30, 2026
maximilliangrand
added a commit
to maximilliangrand/lexical
that referenced
this pull request
Oct 1, 2026
…ion HTML import ## Description The experimental HTML importer drops empty transparent blocks such as `<div><br></div>`. In the Gmail reproduction from meta#4830, pasting produces nine paragraphs instead of eleven. Preserve these authored blank boundaries at the root and in table cells, list items, and code content. The default BR rule retains a sole placeholder only within its owning transparent block. Custom rules that discard the BR, including middleware that discards `$next()`'s result, remain authoritative. List segments are joined by position so a leading empty segment retains its separator. Code imports use the normalization merged in meta#9272. The change touches two production files and adds regression coverage without adding public API. Related to meta#4830 (thanks to @djheyson for the reproduction); meta#9271 addresses the default importer separately. Developed with Codex assistance. ## Test plan ### Before Copied the three regression files onto unchanged upstream `7bfd3e4ef532f87bdace863afe3821a092693b51`, which includes meta#9272: ```sh ./node_modules/.bin/vitest --project unit --run packages/lexical-html/src/__tests__/unit/EmptyBlockImportExtension.test.ts packages/lexical-html/src/__tests__/unit/EmptyBlockImportOverrides.test.ts ``` ```text Test Files 2 failed (2) Tests 28 failed | 5 passed (33) ``` ```sh VITEST_BROWSER=chromium,firefox,webkit ./node_modules/.bin/vitest run --project browser packages/lexical-html/src/__tests__/browser/EmptyBlockImportExtension.test.ts ``` ```text Test Files 3 failed (3) Tests 3 failed (3) ``` ### After The same focused unit command: ```text Test Files 2 passed (2) Tests 33 passed (33) ``` Gmail paste and the merged code-paste regression together: ```sh VITEST_BROWSER=chromium,firefox,webkit ./node_modules/.bin/vitest run --project browser packages/lexical-code-core/src/__tests__/browser/CodeContentImport.test.ts packages/lexical-html/src/__tests__/browser/EmptyBlockImportExtension.test.ts ``` ```text Test Files 6 passed (6) Tests 6 passed (6) ``` All 988 affected unit tests pass across HTML, code-core, code-prism, code-shiki, list, table, rich-text, and clipboard. Test TypeScript, Flow (zero errors), changed-file ESLint/Prettier, and `git diff --check` pass. Coverage includes leading/consecutive/trailing blanks, nested transparent blocks, table cells, list segments, ordinary code import paths, exact blank-line counts beside nested code, custom deletion/replacement rules, paragraph replacements, and Gmail formatting/link preservation. Unit fixtures use DOMParser to match the current test environment. Browser checks dispatch native synthetic clipboard events to mounted contenteditables in Chromium, Firefox, and WebKit on macOS. The full playground end-to-end matrix was not run locally.
zurfyx
added a commit
that referenced
this pull request
Oct 15, 2026
## Description The changes merged since v0.52.0 predate changesets, so without entries the v0.53.0 section would leave them out, including the breaking removal of the deprecated import extensions (#9316). This adds a changeset for every user-facing pull request in v0.52.0..main, written from each pull request, with a `PR: #N` line (they land in this pull request rather than the original ones) and the original author's handle: - breaking: #9316, with the full replacement table as `Migration:` - feature: #9312 - fix: #9335, #9332, #9331, #9328, #9325, #9317, #9321, #9320, #9319, #9283, #9303, #9295, #9291, #9260, #9300, #9301, #9272, #9267, #9302, #9261, #9262, #9263, #9258 - perf: #9264 Skipped as not user-facing: dependency bumps (all devDependencies), website and docs updates, test and CI changes, the private devtools extension and eslint-plugin-internal, and #9353 (a behavior-preserving Flow `Object` to `any` change). It also adds a `[chore]` changeset for this pull request itself, which adds CHANGELOG.md to the `lexical` package's `files`. ## Test plan ### Before ``` $ node scripts/changesets/check.mjs --base origin/main --head HEAD --coverage warn # at the previous commit warning: This pull request changes published code without a changeset for: lexical: packages/lexical/package.json (files) ... Changeset check passed: 0 pending changeset(s) valid; coverage: 1 warning(s), reported only. ``` ### After ``` $ node scripts/changesets/check.mjs --base origin/main Changeset check passed: 27 pending changeset(s) valid; coverage: lexical changed, each named by a changeset. ``` The `latest` release step in a throwaway clone of this branch, with the real tags: ``` $ LATEST_RELEASE=v0.52.0 npm_package_version=0.53.0 node scripts/changesets/release.mjs --date 2026-10-30 Added v0.53.0 to CHANGELOG.md from 27 changeset(s). $ ls .changeset changelog.cjs config.json README.md $ sed -n 1,9p CHANGELOG.md ## v0.53.0 (2026-10-30) ### Breaking changes - **@lexical/code-core, @lexical/code-shiki, @lexical/html, @lexical/link, @lexical/list, @lexical/mdast, @lexical/rich-text, @lexical/table**: Remove the extensions deprecated in v0.52.0 and earlier ([#9316](#9316)) The deprecated import and alias extensions are removed. The `*ImportRules` arrays, including `HorizontalRuleImportRules`, stay. $ grep -n '^### ' CHANGELOG.md | head -7 3:### Breaking changes 28:### Features 36:### Fixes 98:### Performance 102:### Other 106:### Contributors 110:### All changes $ sed -n '/^### Contributors/,+2p' CHANGELOG.md ### Contributors @Tabisharaza, @etrepum, @mbret, @maximilliangrand, @Vedthakar, @rinarakaki, @potatowagon, @followdarko, Gerard Rovira $ sed -n '/^### All changes/,/^## v0.52.0/p' CHANGELOG.md | sed -n '5,6p;$p' | head -2 - [lexical-yjs][Chore] Change last `Object` to `any` in lexical ([#9353](#9353)) Sam Zhou - [lexical-eslint-plugin-internal] Chore: lint window messaging channel scoping ([#9339](#9339)) Sherry ``` (`### All changes` has 50 lines: the 48 commits after v0.52.0, without the `v0.52.0 (#9252)` bump commit, plus this branch's two commits.) Running again before that release PR is merged: ``` $ git tag v0.53.0 # tagged, but CHANGELOG.md on main has no v0.53.0 section $ npm_package_version=0.54.0 node scripts/changesets/release.mjs CHANGELOG.md has no v0.53.0 section, so the v0.53.0 release pull request is not merged yet. Merge it (it consumes the changesets for v0.53.0) before cutting v0.54.0; running again now would put the same changesets in both releases. (exit 1) $ npm_package_version=0.53.1 node scripts/changesets/release.mjs Refusing to release 0.53.1 as a patch: 1 pending [breaking] changeset(s) need a minor release: - .changeset/remove-deprecated-import-extensions.md: Remove the extensions deprecated in v0.52.0 and earlier Run the release with the "minor" increment instead. (exit 1) ``` A prerelease publish (lexical at 0.52.1-nightly.20261016.0, nothing built, so the export check that follows fails as expected): ``` $ node scripts/npm/prepare-release.mjs [lexical] CHANGELOG.md lists pending changes as Unreleased [lexical] package.json references files that are not present in packages/lexical: ./dist/Lexical.dev.js $ sed -n 1,5p packages/lexical/CHANGELOG.md ## Unreleased Merged after the latest stable release and included in 0.52.1-nightly.20261016.0. These entries move into a version section when the next stable release is cut. ### Breaking changes $ git status --short CHANGELOG.md (clean: only the gitignored package copy changed) ```
zurfyx
added a commit
that referenced
this pull request
Oct 15, 2026
## Description The changes merged since v0.52.0 predate changesets, so without entries the v0.53.0 section would leave them out, including the breaking removal of the deprecated import extensions (#9316). This adds a changeset for every user-facing pull request in v0.52.0..main, written from each pull request, with a `PR: #N` line (they land in this pull request rather than the original ones) and the original author's handle: - breaking: #9316, with the full replacement table as `Migration:` - feature: #9312 - fix: #9335, #9332, #9331, #9328, #9325, #9317, #9321, #9320, #9319, #9283, #9303, #9295, #9291, #9260, #9300, #9301, #9272, #9267, #9302, #9261, #9262, #9263, #9258 - perf: #9264 Skipped as not user-facing: dependency bumps (all devDependencies), website and docs updates, test and CI changes, the private devtools extension and eslint-plugin-internal, and #9353 (a behavior-preserving Flow `Object` to `any` change). Four fixes change observable output or behavior, so their changesets have a `Verify:` paragraph and are listed under Behavior changes: #9303 (new tabs get no `window.opener`), #9272 (imported code content is normalized), #9261 (`$patchStyleText` styles the selection it is given), #9319 (editor keys and namespaces are a counter without a DOM). It also adds a `[chore]` changeset for this pull request itself, which adds CHANGELOG.md to the `lexical` package's `files`. ## Test plan ### Before ``` $ node scripts/changesets/check.mjs --base origin/main --head HEAD --coverage warn # at the previous commit warning: This pull request changes published code without a changeset for: lexical: packages/lexical/package.json (files) ... Changeset check passed: 0 pending changeset(s) valid; coverage: 1 warning(s), reported only. ``` ### After ``` $ node scripts/changesets/check.mjs --base origin/main Changeset check passed: 27 pending changeset(s) valid; coverage: lexical changed, each named by a changeset. ``` The `latest` release step in a throwaway clone of this branch, with the real tags: ``` $ LATEST_RELEASE=v0.52.0 npm_package_version=0.53.0 node scripts/changesets/release.mjs --date 2026-10-30 Added v0.53.0 to CHANGELOG.md from 27 changeset(s). $ ls .changeset changelog.cjs config.json README.md $ sed -n 1,9p CHANGELOG.md ## v0.53.0 (2026-10-30) ### Breaking changes - **@lexical/code-core, @lexical/code-shiki, @lexical/html, @lexical/link, @lexical/list, @lexical/mdast, @lexical/rich-text, @lexical/table**: Remove the extensions deprecated in v0.52.0 and earlier ([#9316](#9316)) The deprecated import and alias extensions are removed. The `*ImportRules` arrays, including `HorizontalRuleImportRules`, stay. $ grep -n '^### ' CHANGELOG.md | head -8 3:### Breaking changes 28:### Behavior changes 54:### Features 62:### Fixes 108:### Performance 112:### Other 116:### Contributors 120:### All changes $ sed -n '/^### Behavior changes/,+7p' CHANGELOG.md ### Behavior changes - **@lexical/link**: Open new-tab links from `ClickableLinkPlugin` / `registerClickableLink` without `window.opener` ([#9303](#9303)) This prevents the opened page from navigating the editor's tab (reverse tabnabbing). Same-tab opens are unchanged. Verify: pages opened from editor links that relied on `window.opener`. $ node scripts/changesets/range.mjs --from 0.52.0 --breaking --json # (kind, [(pr, behavior)]) [('breaking', [(9316, False)]), ('behavior', [(9303, True), (9272, True), (9261, True), (9319, True)])] $ sed -n '/^### Contributors/,+2p' CHANGELOG.md ### Contributors @Tabisharaza, @etrepum, @mbret, @maximilliangrand, @Vedthakar, @rinarakaki, @potatowagon, @followdarko, Gerard Rovira $ sed -n '/^### All changes/,/^## v0.52.0/p' CHANGELOG.md | sed -n '5,6p;$p' | head -2 - [lexical-yjs][Chore] Change last `Object` to `any` in lexical ([#9353](#9353)) Sam Zhou - [lexical-eslint-plugin-internal] Chore: lint window messaging channel scoping ([#9339](#9339)) Sherry ``` (`### All changes` has 50 lines: the 48 commits after v0.52.0, without the `v0.52.0 (#9252)` bump commit, plus this branch's two commits.) Running again before that release PR is merged: ``` $ git tag v0.53.0 # tagged, but CHANGELOG.md on main has no v0.53.0 section $ npm_package_version=0.54.0 node scripts/changesets/release.mjs CHANGELOG.md has no v0.53.0 section, so the v0.53.0 release pull request is not merged yet. Merge it (it consumes the changesets for v0.53.0) before cutting v0.54.0; running again now would put the same changesets in both releases. (exit 1) $ npm_package_version=0.53.1 node scripts/changesets/release.mjs Refusing to release 0.53.1 as a patch: 1 pending [breaking] changeset(s) need a minor release: - .changeset/remove-deprecated-import-extensions.md: Remove the extensions deprecated in v0.52.0 and earlier Run the release with the "minor" increment instead. (exit 1) ``` A prerelease publish (lexical at 0.52.1-nightly.20261016.0, nothing built, so the export check that follows fails as expected): ``` $ node scripts/npm/prepare-release.mjs [lexical] CHANGELOG.md lists pending changes as Unreleased [lexical] package.json references files that are not present in packages/lexical: ./dist/Lexical.dev.js $ sed -n 1,5p packages/lexical/CHANGELOG.md ## Unreleased Merged after the latest stable release and included in 0.52.1-nightly.20261016.0. These entries move into a version section when the next stable release is cut. ### Breaking changes $ git status --short CHANGELOG.md (clean: only the gitignored package copy changed) ```
zurfyx
added a commit
that referenced
this pull request
Oct 15, 2026
## Description The changes merged since v0.52.0 predate changesets, so without entries the v0.53.0 section would leave them out, including the breaking removal of the deprecated import extensions (#9316). This adds a changeset for every user-facing pull request in v0.52.0..main, written from each pull request, with a `PR: #N` line (they land in this pull request rather than the original ones) and the original author's handle: - breaking: #9316, with the full replacement table as `Migration:` - feature: #9312 - fix: #9335, #9332, #9331, #9328, #9325, #9317, #9321, #9320, #9319, #9283, #9303, #9295, #9291, #9260, #9300, #9301, #9272, #9267, #9302, #9261, #9262, #9263, #9258 - perf: #9264 Skipped as not user-facing: dependency bumps (all devDependencies), website and docs updates, test and CI changes, the private devtools extension and eslint-plugin-internal, and #9353 (a behavior-preserving Flow `Object` to `any` change). Four fixes change observable output or behavior, so their changesets have a `Verify:` paragraph and are listed under Behavior changes: #9303 (new tabs get no `window.opener`), #9272 (imported code content is normalized), #9261 (`$patchStyleText` styles the selection it is given), #9319 (editor keys and namespaces are a counter without a DOM). It also adds a `[chore]` changeset for this pull request itself, which adds CHANGELOG.md to the `lexical` package's `files`. ## Test plan ### Before ``` $ node scripts/changesets/check.mjs --base origin/main --head HEAD --coverage warn # at the previous commit warning: This pull request changes published code without a changeset for: lexical: packages/lexical/package.json (files) ... Changeset check passed: 0 pending changeset(s) valid; coverage: 1 warning(s), reported only. ``` ### After ``` $ node scripts/changesets/check.mjs --base origin/main Changeset check passed: 27 pending changeset(s) valid; coverage: lexical changed, each named by a changeset. ``` The `latest` release step in a throwaway clone of this branch, with the real tags: ``` $ LATEST_RELEASE=v0.52.0 npm_package_version=0.53.0 node scripts/changesets/release.mjs --date 2026-10-30 Added v0.53.0 to CHANGELOG.md from 27 changeset(s). $ ls .changeset changelog.cjs config.json README.md $ sed -n 1,9p CHANGELOG.md ## v0.53.0 (2026-10-30) ### Breaking changes - **@lexical/code-core, @lexical/code-shiki, @lexical/html, @lexical/link, @lexical/list, @lexical/mdast, @lexical/rich-text, @lexical/table**: Remove the extensions deprecated in v0.52.0 and earlier ([#9316](#9316)) The deprecated import and alias extensions are removed. The `*ImportRules` arrays, including `HorizontalRuleImportRules`, stay. $ grep -n '^### ' CHANGELOG.md | head -8 3:### Breaking changes 28:### Behavior changes 54:### Features 62:### Fixes 108:### Performance 112:### Other 116:### Contributors 120:### All changes $ sed -n '/^### Behavior changes/,+7p' CHANGELOG.md ### Behavior changes - **@lexical/link**: Open new-tab links from `ClickableLinkPlugin` / `registerClickableLink` without `window.opener` ([#9303](#9303)) This prevents the opened page from navigating the editor's tab (reverse tabnabbing). Same-tab opens are unchanged. Verify: pages opened from editor links that relied on `window.opener`. $ node scripts/changesets/range.mjs --from 0.52.0 --breaking --json # (kind, [(pr, behavior)]) [('breaking', [(9316, False)]), ('behavior', [(9303, True), (9272, True), (9261, True), (9319, True)])] $ sed -n '/^### Contributors/,+2p' CHANGELOG.md ### Contributors @Tabisharaza, @etrepum, @mbret, @maximilliangrand, @Vedthakar, @rinarakaki, @potatowagon, @followdarko, Gerard Rovira $ sed -n '/^### All changes/,/^## v0.52.0/p' CHANGELOG.md | sed -n '5,6p;$p' | head -2 - [lexical-yjs][Chore] Change last `Object` to `any` in lexical ([#9353](#9353)) Sam Zhou - [lexical-eslint-plugin-internal] Chore: lint window messaging channel scoping ([#9339](#9339)) Sherry ``` (`### All changes` has 50 lines: the 48 commits after v0.52.0, without the `v0.52.0 (#9252)` bump commit, plus this branch's two commits.) Running again before that release PR is merged: ``` $ git tag v0.53.0 # tagged, but CHANGELOG.md on main has no v0.53.0 section $ npm_package_version=0.54.0 node scripts/changesets/release.mjs CHANGELOG.md has no v0.53.0 section, so the v0.53.0 release pull request is not merged yet. Merge it (it consumes the changesets for v0.53.0) before cutting v0.54.0; running again now would put the same changesets in both releases. (exit 1) $ npm_package_version=0.53.1 node scripts/changesets/release.mjs Refusing to release 0.53.1 as a patch: 1 pending [breaking] changeset(s) need a minor release: - .changeset/remove-deprecated-import-extensions.md: Remove the extensions deprecated in v0.52.0 and earlier Run the release with the "minor" increment instead. (exit 1) ``` A prerelease publish (lexical at 0.52.1-nightly.20261016.0, nothing built, so the export check that follows fails as expected): ``` $ node scripts/npm/prepare-release.mjs [lexical] CHANGELOG.md lists pending changes as Unreleased [lexical] package.json references files that are not present in packages/lexical: ./dist/Lexical.dev.js $ sed -n 1,5p packages/lexical/CHANGELOG.md ## Unreleased Merged after the latest stable release and included in 0.52.1-nightly.20261016.0. These entries move into a version section when the next stable release is cut. ### Breaking changes $ git status --short CHANGELOG.md (clean: only the gitignored package copy changed) ```
Merged
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.
Description
HTML code imports can retain paragraphs, headings, links, and other nested nodes inside a CodeNode. Two imported paragraphs can become
alpha\n\nbetainstead of adjacent code lines, and code editing helpers do not support those nested children.Normalize all six code-import paths to
CodeHighlightNode,TabNode, andLineBreakNodeusing the existing$plainifyCodeContenthelper. Imported nodes supply theirgetTextContent()representation, with one line break between top-level siblings when either is block-level. This supports custom subclasses and configured node replacements without constructor checks; nested containers retain their own plain-text separators. Plain monospace DIV descendants retain their line boundaries.Applies to the experimental HTML importer. Developed with Codex assistance and independently checked against current upstream.
Test plan
Before
Copied the final tests onto unmodified current main
f0fefed7bc894b19837c7b921043427fa84ba3b9:After
The same commands, both on this branch and with only the revised importer applied to that current-main checkout:
Tests assert the supported child types before highlighting can normalize them. Coverage includes all six import paths, leading/consecutive/trailing empty paragraphs, nested code/headings/links/lists/tables, custom text representations, configured paragraph replacements, decorators, CRLF, tabs, and hard line breaks.
Additional checks on this branch: 948 affected unit tests and 339 source tree-shaking tests pass; source/test TypeScript, changed-file ESLint/Prettier, and
git diff --checkpass. Browser tests dispatch native synthetic paste events to a mounted contenteditable in Chromium, Firefox, and WebKit on macOS and verify the rendered code DOM. The full playground end-to-end matrix was not run locally.