mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 05:39:11 +03:00
MDXEditor's markdownShortcutPlugin reads match[1] from Lexical's code fence regex. Lexical 0.48 added a capture group for the fence itself, shifting the language to match[2], so typing ```sql set the code block language to the literal fence. MDXEditor 4.1.0 adopted 0.48 without updating the index; it is still wrong on 4.2.3 and on main upstream. The patch fixed this with a one-character change, but a patched dependency is a lot of weight for the symptom. Only the typing shortcut is affected -- markdown import goes through MdastCodeVisitor and reads mdastNode.lang -- so normalizing a bare fence to an unset language in getCodeBlockLanguage covers it. Typing ```sql now yields a plain text block that the existing language picker can change. Narrow the guard to fences rather than falling back for every unknown language, so a genuine ```python block still shows its own name instead of being relabeled as plain text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>