Fix #1972 - Evaluate users' code a part (#1975)

This commit is contained in:
Andrea Giammarchi
2024-02-09 15:52:29 +01:00
committed by GitHub
parent d7084f7f55
commit 30c6c830ae
3 changed files with 47 additions and 29 deletions

View File

@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../dist/core.css">
<script type="module">
import { hooks } from "../dist/core.js";
hooks.main.codeBeforeRun.add('print(0)');
hooks.main.codeAfterRun.add('print(2)');
</script>
</head>
<body>
<script type="py">
# raise an error instead to see it on line 1
print(1)
</script>
</body>
</html>