-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
In the source ( .PlaygroundEditorTheme__code:before {
content: attr(data-gutter);
position: sticky; left: 0; float: left;
}So, to get the gutter in your editor (not by editing the exported HTML):
If you're displaying the exported HTML statically (outside a live Lexical editor), |
Beta Was this translation helpful? Give feedback.



data-gutterisn't part of the exported HTML — it's added at runtime by the code-highlighting plugin, and the line-number column itself is pure CSS. That's why copying the static "Convert to HTML" output doesn't carry it.In the source (
@lexical/code-prism,CodeHighlighterPrism.ts),updateCodeGutter()builds the line-number string and doescodeElement.setAttribute('data-gutter', gutter)("1\n2\n3…"), run from a mutation listener registered byregisterCodeHighlighting(editor). The Playground theme then draws it straight from the attribute:So, to get the gutter in your editor (not…