Skip to content

[lexical-website] Bug Fix: Remove embed=1 from non-iframe StackBlitz links#8531

Merged
etrepum merged 1 commit into
facebook:mainfrom
etrepum:claude/fix-stackblitz-embed-param-oppbz
May 21, 2026
Merged

[lexical-website] Bug Fix: Remove embed=1 from non-iframe StackBlitz links#8531
etrepum merged 1 commit into
facebook:mainfrom
etrepum:claude/fix-stackblitz-embed-param-oppbz

Conversation

@etrepum

@etrepum etrepum commented May 21, 2026

Copy link
Copy Markdown
Collaborator

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

…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.
@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment May 21, 2026 12:35am
lexical-playground Ready Ready Preview, Comment May 21, 2026 12:35am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 21, 2026
@etrepum etrepum changed the title [lexical-website][Documentation Update] Remove embed=1 from non-iframe StackBlitz links May 21, 2026
@etrepum etrepum marked this pull request as ready for review May 21, 2026 01:07
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label May 21, 2026
@etrepum etrepum added this pull request to the merge queue May 21, 2026
Merged via the queue into facebook:main with commit d806f4b May 21, 2026
45 checks passed
@etrepum etrepum deleted the claude/fix-stackblitz-embed-param-oppbz branch May 21, 2026 14:14
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
@etrepum etrepum mentioned this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

3 participants