Skip to content

Commit 33ff194

Browse files
Merge pull request #10 from NetLogo-Mobile/advanced_parser
Drop fixedadv_parser
2 parents 1f46c4b + e3a810a commit 33ff194

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/services/pltxt2htm/advancedParser.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ import hljs from "highlight.js";
44
import dompurify from "dompurify";
55
// import renderMathInElement from "katex/contrib/auto-render/auto-render.js";
66

7-
async function fixedadvParser(text: string, host: string): Promise<string> {
7+
async function advancedParser(text: string, host: string): Promise<string> {
88
const wasmInstance = await getWasmInstance();
99
const instanceAny: any = wasmInstance;
10-
if (!instanceAny.__fixedadv_parser_fn) {
11-
instanceAny.__fixedadv_parser_fn = wasmInstance.cwrap(
12-
"fixedadv_parser",
10+
if (!instanceAny.__advanced_parser_fn) {
11+
instanceAny.__advanced_parser_fn = wasmInstance.cwrap(
12+
"advanced_parser",
1313
"number",
1414
["string", "string"]
1515
);
1616
}
1717
let deallocate = await getDeallocator();
1818
let char8_t_const_ptr = (
19-
instanceAny.__fixedadv_parser_fn as (t: string, h: string) => number
19+
instanceAny.__advanced_parser_fn as (t: string, h: string) => number
2020
)(text, host);
2121
let result = wasmInstance.UTF8ToString(char8_t_const_ptr);
2222
deallocate(char8_t_const_ptr);
2323
return result;
2424
}
2525

2626
async function parse(source: string) {
27-
const rawHtml = await fixedadvParser(source, import.meta.env.VITE_ROOT_URL);
27+
const rawHtml = await advancedParser(source, import.meta.env.VITE_ROOT_URL);
2828
console.log(rawHtml)
2929
if (!rawHtml) return "";
3030
const tempDiv = document.createElement("div");

0 commit comments

Comments
 (0)