ironmark 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -1
- package/package.json +2 -2
- package/wasm/node.js +1 -1
- package/wasm/pkg/ironmark_bg.js +47 -6
- package/wasm/pkg/ironmark_bg.wasm +0 -0
package/wasm/pkg/ironmark_bg.js
CHANGED
|
@@ -40,8 +40,8 @@ export function parse(markdown, hard_breaks, enable_highlight, enable_strikethro
|
|
|
40
40
|
* @returns {string}
|
|
41
41
|
*/
|
|
42
42
|
export function parseToAst(markdown, hard_breaks, enable_highlight, enable_strikethrough, enable_underline, enable_tables, enable_autolink, enable_task_lists) {
|
|
43
|
-
let
|
|
44
|
-
let
|
|
43
|
+
let deferred3_0;
|
|
44
|
+
let deferred3_1;
|
|
45
45
|
try {
|
|
46
46
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
47
47
|
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -49,14 +49,42 @@ export function parseToAst(markdown, hard_breaks, enable_highlight, enable_strik
|
|
|
49
49
|
wasm.parseToAst(retptr, ptr0, len0, isLikeNone(hard_breaks) ? 0xFFFFFF : hard_breaks ? 1 : 0, isLikeNone(enable_highlight) ? 0xFFFFFF : enable_highlight ? 1 : 0, isLikeNone(enable_strikethrough) ? 0xFFFFFF : enable_strikethrough ? 1 : 0, isLikeNone(enable_underline) ? 0xFFFFFF : enable_underline ? 1 : 0, isLikeNone(enable_tables) ? 0xFFFFFF : enable_tables ? 1 : 0, isLikeNone(enable_autolink) ? 0xFFFFFF : enable_autolink ? 1 : 0, isLikeNone(enable_task_lists) ? 0xFFFFFF : enable_task_lists ? 1 : 0);
|
|
50
50
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
51
51
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
53
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
54
|
+
var ptr2 = r0;
|
|
55
|
+
var len2 = r1;
|
|
56
|
+
if (r3) {
|
|
57
|
+
ptr2 = 0; len2 = 0;
|
|
58
|
+
throw takeObject(r2);
|
|
59
|
+
}
|
|
60
|
+
deferred3_0 = ptr2;
|
|
61
|
+
deferred3_1 = len2;
|
|
62
|
+
return getStringFromWasm0(ptr2, len2);
|
|
55
63
|
} finally {
|
|
56
64
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
57
|
-
wasm.__wbindgen_export3(
|
|
65
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
58
66
|
}
|
|
59
67
|
}
|
|
68
|
+
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
69
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
70
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
71
|
+
return addHeapObject(ret);
|
|
72
|
+
}
|
|
73
|
+
function addHeapObject(obj) {
|
|
74
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
75
|
+
const idx = heap_next;
|
|
76
|
+
heap_next = heap[idx];
|
|
77
|
+
|
|
78
|
+
heap[idx] = obj;
|
|
79
|
+
return idx;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function dropObject(idx) {
|
|
83
|
+
if (idx < 1028) return;
|
|
84
|
+
heap[idx] = heap_next;
|
|
85
|
+
heap_next = idx;
|
|
86
|
+
}
|
|
87
|
+
|
|
60
88
|
let cachedDataViewMemory0 = null;
|
|
61
89
|
function getDataViewMemory0() {
|
|
62
90
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
@@ -78,6 +106,13 @@ function getUint8ArrayMemory0() {
|
|
|
78
106
|
return cachedUint8ArrayMemory0;
|
|
79
107
|
}
|
|
80
108
|
|
|
109
|
+
function getObject(idx) { return heap[idx]; }
|
|
110
|
+
|
|
111
|
+
let heap = new Array(1024).fill(undefined);
|
|
112
|
+
heap.push(undefined, null, true, false);
|
|
113
|
+
|
|
114
|
+
let heap_next = heap.length;
|
|
115
|
+
|
|
81
116
|
function isLikeNone(x) {
|
|
82
117
|
return x === undefined || x === null;
|
|
83
118
|
}
|
|
@@ -119,6 +154,12 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
119
154
|
return ptr;
|
|
120
155
|
}
|
|
121
156
|
|
|
157
|
+
function takeObject(idx) {
|
|
158
|
+
const ret = getObject(idx);
|
|
159
|
+
dropObject(idx);
|
|
160
|
+
return ret;
|
|
161
|
+
}
|
|
162
|
+
|
|
122
163
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
123
164
|
cachedTextDecoder.decode();
|
|
124
165
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
Binary file
|