Files
obsidian-excalidraw-plugin/scripts/testing/host/nativeKeyboard.mjs
zsviczian f31dff9ec1 fix: prevent recursive Markdown embeds during PDF export
Claim drawing image embeds synchronously before yielding to Obsidian's native embed discovery. Preserve native images, text references and hybrid Markdown rendering, and cover main/popout PDF preparation. Correct macOS editing commands in native test input.

Validation: 871 portable cases passed, PDF/embed and installed K-Plex checks passed. Separate native Mac Cmd+S and failed-path cleanup checks remain failing; their evidence is preserved.
2026-11-05 07:05:13 +01:00

9 lines
584 B
JavaScript

/** CDP needs explicit browser editing commands for macOS shortcuts, as Playwright's Chromium driver does. */
export function nativeKeyboardInput(params, platform = process.platform) {
if (platform !== "darwin" || !["keyDown", "rawKeyDown"].includes(params.type) || params.commands) return params;
const command = params.modifiers === 4 && params.code === "KeyA" ? "selectAll"
: params.modifiers === 4 && params.code === "KeyZ" ? "undo"
: params.modifiers === 12 && params.code === "KeyZ" ? "redo" : null;
return command ? { ...params, commands: [command] } : params;
}