Repository navigation
[lexical-website] Documentation Update: fix seven incorrect API references in the DOM import guide - #9222
Merged
Conversation
…ences in the DOM import guide
## Description
Seven corrections in `serialization/dom-import.md`, all against the code the
page documents:
1. **`$createQuoteNode` imported from `@lexical/html`** — that package exports
no such symbol; it lives in `@lexical/rich-text`.
2. **The `ClipboardImportExtension` example names its third handler parameter
`editor`** and passes it to `$insertGeneratedNodes`. The third parameter is
`$next: () => boolean`. The page's own prose two paragraphs earlier states
the correct signature, and the real handler in `ClipboardImportExtension`
uses `$getEditor()` — so the example now does too.
3. **`sel.attr('target', 'true')` commented "attribute present"** — a string
argument is an exact-value match (it matches `target="true"` and nothing
else). Presence is the boolean `true` overload.
4. **`sel.styleAny('fontSize', …)`** — the property is read through CSSOM
`getPropertyValue`, which needs the dashed name. `'fontSize'` returns `''`,
so the selector can never match.
5. **`ImportOverlays` described as `{dispatch: CompiledDispatch}[]`** — it
holds `readonly CompiledOverlayRules[]`.
6. **"see the `INLINE_TAG_RE` / `BLOCK_TAG_RE` exports"** — both are
module-private constants, not exported from `lexical`.
7. **"rejected blocks hoist out"** — `InlineSchema` declares no `onReject`, so
rejected runs are dropped (`'drop'` is the default). The same page's table
already says "Dropped".
## Test plan
Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that each reference matches source.
### Before
```
$ grep -n "createQuoteNode\|attr('target'\|styleAny('fontSize'\|CompiledDispatch\|INLINE_TAG_RE" packages/lexical-website/docs/serialization/dom-import.md
262:sel.tag('a').attr('target', 'true') // attribute present
264:sel.tag('span').styleAny('fontSize', /^(\d+)pt/) // inline-style match
551:- **`ImportOverlays`** — session slot (`{dispatch: CompiledDispatch}[]`)
584:see the `INLINE_TAG_RE` / `BLOCK_TAG_RE` exports if you want to
1142: conversion: (_el) => ({node: $createQuoteNode()}),
1154: $createQuoteNode,
1163: const node = $createQuoteNode();
$ grep -rn "createQuoteNode" packages/lexical-html/src | wc -l
0
$ grep -n "INLINE_TAG_RE\|BLOCK_TAG_RE" packages/lexical/src/index.ts | wc -l
0
$ sed -n '969,971p' packages/lexical-website/docs/serialization/dom-import.md
(data, selection, editor) => {
const nodes = parseMyAppFormat(data);
$insertGeneratedNodes(editor, nodes, selection);
```
### After
```
$ sed -n '262,264p' packages/lexical-website/docs/serialization/dom-import.md
sel.tag('a').attr('target', true) // attribute present
sel.tag('span').styleAny('font-size', /^(\d+)pt/) // inline-style match
$ sed -n '969,971p' packages/lexical-website/docs/serialization/dom-import.md
(data, selection) => {
const nodes = parseMyAppFormat(data);
$insertGeneratedNodes($getEditor(), nodes, selection);
$ grep -n "createQuoteNode} from" packages/lexical-website/docs/serialization/dom-import.md
1159:import {$createQuoteNode} from '@lexical/rich-text';
```
Sources: `packages/lexical-rich-text/src/index.ts:321` (`$createQuoteNode`);
`packages/lexical-clipboard/src/ClipboardImportExtension.ts:67-72`
(`ImportMimeTypeFunction`) and `:550` (the real handler's `$getEditor()`);
`packages/lexical-html/src/import/sel.ts:164-168` (`value === true` is the
presence test) and `:214` (`node.style.getPropertyValue(prop)`);
`packages/lexical-html/src/import/ImportContext.ts:265-270`
(`readonly CompiledOverlayRules[]`);
`packages/lexical/src/LexicalUtils.ts:2684,2703` (both `const`, absent from
`packages/lexical/src/index.ts`);
`packages/lexical-html/src/import/schemas.ts:240-243` (`InlineSchema` has no
`onReject`) with the `'drop'` default at `import/types.ts:320`.
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 24, 2026 16:46
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 24, 2026
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
Seven corrections in
serialization/dom-import.md, all against the code thepage documents:
$createQuoteNodeimported from@lexical/html— that package exportsno such symbol; it lives in
@lexical/rich-text.ClipboardImportExtensionexample names its third handler parametereditorand passes it to$insertGeneratedNodes. The third parameter is$next: () => boolean. The page's own prose two paragraphs earlier statesthe correct signature, and the real handler in
ClipboardImportExtensionuses
$getEditor()— so the example now does too.sel.attr('target', 'true')commented "attribute present" — a stringargument is an exact-value match (it matches
target="true"and nothingelse). Presence is the boolean
trueoverload.sel.styleAny('fontSize', …)— the property is read through CSSOMgetPropertyValue, which needs the dashed name.'fontSize'returns'',so the selector can never match.
ImportOverlaysdescribed as{dispatch: CompiledDispatch}[]— itholds
readonly CompiledOverlayRules[].INLINE_TAG_RE/BLOCK_TAG_REexports" — both aremodule-private constants, not exported from
lexical.InlineSchemadeclares noonReject, sorejected runs are dropped (
'drop'is the default). The same page's tablealready says "Dropped".
Test plan
Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that each reference matches source.Before
After
Sources:
packages/lexical-rich-text/src/index.ts:321($createQuoteNode);packages/lexical-clipboard/src/ClipboardImportExtension.ts:67-72(
ImportMimeTypeFunction) and:550(the real handler's$getEditor());packages/lexical-html/src/import/sel.ts:164-168(value === trueis thepresence test) and
:214(node.style.getPropertyValue(prop));packages/lexical-html/src/import/ImportContext.ts:265-270(
readonly CompiledOverlayRules[]);packages/lexical/src/LexicalUtils.ts:2684,2703(bothconst, absent frompackages/lexical/src/index.ts);packages/lexical-html/src/import/schemas.ts:240-243(InlineSchemahas noonReject) with the'drop'default atimport/types.ts:320.