MCPcopy Index your code
hub / github.com/TypeCellOS/BlockNote / copyPasteAllExternal

Function copyPasteAllExternal

tests/src/utils/copypaste.ts:18–32  ·  view source on GitHub ↗
(
  page: Page,
  os: "mac" | "linux" = "linux",
)

Source from the content-addressed store, hash-verified

16}
17
18export async function copyPasteAllExternal(
19 page: Page,
20 os: "mac" | "linux" = "linux",
21) {
22 const modifierKey = os === "mac" ? "Meta" : "Control";
23 await page.keyboard.press(`${modifierKey}+A`);
24 await page.keyboard.press(`${modifierKey}+C`);
25 await focusOnEditor(page);
26
27 const pasteZone = page.locator(PASTE_ZONE_SELECTOR);
28 await pasteZone.click();
29 await page.keyboard.press(`${modifierKey}+V`);
30
31 return await pasteZone.inputValue();
32}
33
34export function removeClassesFromHTML(html: string) {
35 return html.replace(/class="\S*"\s/g, "");

Callers 1

Calls 1

focusOnEditorFunction · 0.85

Tested by

no test coverage detected