File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,27 +4,27 @@ import hljs from "highlight.js";
44import 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
2626async 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" ) ;
You can’t perform that action at this time.
0 commit comments