[lexical-website] Bug Fix: Remove embed=1 from non-iframe StackBlitz links#8531
Merged
etrepum merged 1 commit intoMay 21, 2026
Merged
Conversation
…e StackBlitz links The embed=1 query param only works when the StackBlitz URL is loaded inside an iframe. Links that open in a new window/tab (markdown links and gallery cards via target="_blank") fail to load with embed=1, so strip the param from those URLs while leaving the iframe src URLs untouched.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zurfyx
approved these changes
May 21, 2026
etrepum
pushed a commit
to etrepum/lexical
that referenced
this pull request
May 21, 2026
…folds VS Code → Chrome/Safari paste shapes into a single \<pre\>
[dev-examples/dom-import] Add code blocks + Shiki syntax highlighting to the example editor
VS Code → browser pastes ship the same code block as two different DOM
shapes depending on the browser:
- Chrome: one outer
<div style="font-family: …monospace…; white-space: pre">…
wrapping per-line <div>s and <br>s.
- Safari: a flat run of sibling
<div style="…monospace…; white-space: pre">…
and <br style="…"> elements with no wrapping monospace ancestor —
the styles are duplicated onto every element.
The legacy DivRule produced one CodeNode per <div> on Safari and
concatenated inner divs without separating \\n on Chrome. Rather than
encode that grouping into a rule (which would have to decide per-
element whether it's part of a run), the new $consolidateVscodeCodePaste
preprocess detects either shape globally and rewrites it into a single
<pre> with newline-joined text. The existing PreRule then imports the
<pre> as a single CodeNode. Two unit tests for the Chrome and Safari
fixtures are added; the legacy importDOM still produces multiple
CodeNodes for the Safari case — fixing that is out of scope, the goal
is just that the DOMImportExtension pipeline handles it.
Also adds code-block support to the dev-example: CodeShikiExtension
registers CodeNode / CodeHighlightNode and wires Shiki up as the
in-editor highlighter; CodeImportExtension adds the import rules
(<pre>, multi-line <code>, GitHub raw-file-view, monospace <div>,
and the new VS Code consolidation preprocess).
Sync with main (StackBlitz embed=1 cleanup facebook#8531 from upstream).
https://claude.ai/code/session_01BmrdosvEycxnHaj85MeMNQ
Merged
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
The embed=1 query param only works when the StackBlitz URL is loaded inside an iframe. Links that open in a new window/tab (markdown links and gallery cards via target="_blank") fail to load with embed=1, so strip the param from those URLs while leaving the iframe src URLs untouched.
Test plan
Before
The preview doesn't load (reports a compatibility error when there isn't one) when clicking on a demo from https://lexical.dev/gallery
After
The previews load