Skip to content

Commit 6f2ff4c

Browse files
committed
feat: outputHanzi for browser runtime
1 parent 7f24f4c commit 6f2ff4c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/browser_runtime.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77

88
async function run(script) {
99
const scoped = !!script.attributes.scoped;
10+
const outputHanzi = !(
11+
script.attributes.outputHanzi &&
12+
script.attributes.outputHanzi.value === "false"
13+
);
1014
let code = script.innerText;
1115
if (script.src) {
1216
const response = await fetch(script.src);
1317
code = (await response.text()).toString();
1418
}
1519
execute(code, {
1620
scoped,
21+
outputHanzi,
1722
logCallback: isDev ? console.log : () => {},
1823
resetVarCnt: false
1924
});

0 commit comments

Comments
 (0)