novelaid-markdown 0.2.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 ADDED
@@ -0,0 +1,6 @@
1
+ # novelaid-markdown
2
+
3
+ 小説執筆アプリである[novelaid-editor](https://github.com/mituha/novelaid-editor)のマークダウン表示部分をライブラリ化するためのものです。
4
+
5
+ Reactのコンポーネントとして提供します。
6
+
@@ -0,0 +1,129 @@
1
+ //#region node_modules/mdast-util-to-string/lib/index.js
2
+ var e = {};
3
+ function t(t, r) {
4
+ let i = r || e;
5
+ return n(t, typeof i.includeImageAlt == "boolean" ? i.includeImageAlt : !0, typeof i.includeHtml == "boolean" ? i.includeHtml : !0);
6
+ }
7
+ function n(e, t, n) {
8
+ if (i(e)) {
9
+ if ("value" in e) return e.type === "html" && !n ? "" : e.value;
10
+ if (t && "alt" in e && e.alt) return e.alt;
11
+ if ("children" in e) return r(e.children, t, n);
12
+ }
13
+ return Array.isArray(e) ? r(e, t, n) : "";
14
+ }
15
+ function r(e, t, r) {
16
+ let i = [], a = -1;
17
+ for (; ++a < e.length;) i[a] = n(e[a], t, r);
18
+ return i.join("");
19
+ }
20
+ function i(e) {
21
+ return !!(e && typeof e == "object");
22
+ }
23
+ //#endregion
24
+ //#region node_modules/micromark-util-chunked/index.js
25
+ function a(e, t, n, r) {
26
+ let i = e.length, a = 0, o;
27
+ if (t = t < 0 ? -t > i ? 0 : i + t : t > i ? i : t, n = n > 0 ? n : 0, r.length < 1e4) o = Array.from(r), o.unshift(t, n), e.splice(...o);
28
+ else for (n && e.splice(t, n); a < r.length;) o = r.slice(a, a + 1e4), o.unshift(t, 0), e.splice(...o), a += 1e4, t += 1e4;
29
+ }
30
+ function o(e, t) {
31
+ return e.length > 0 ? (a(e, e.length, 0, t), e) : t;
32
+ }
33
+ //#endregion
34
+ //#region node_modules/micromark-util-combine-extensions/index.js
35
+ var s = {}.hasOwnProperty;
36
+ function c(e) {
37
+ let t = {}, n = -1;
38
+ for (; ++n < e.length;) l(t, e[n]);
39
+ return t;
40
+ }
41
+ function l(e, t) {
42
+ let n;
43
+ for (n in t) {
44
+ let r = (s.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n], a;
45
+ if (i) for (a in i) {
46
+ s.call(r, a) || (r[a] = []);
47
+ let e = i[a];
48
+ u(r[a], Array.isArray(e) ? e : e ? [e] : []);
49
+ }
50
+ }
51
+ }
52
+ function u(e, t) {
53
+ let n = -1, r = [];
54
+ for (; ++n < t.length;) (t[n].add === "after" ? e : r).push(t[n]);
55
+ a(e, 0, 0, r);
56
+ }
57
+ //#endregion
58
+ //#region node_modules/micromark-util-normalize-identifier/index.js
59
+ function d(e) {
60
+ return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
61
+ }
62
+ //#endregion
63
+ //#region node_modules/micromark-util-character/index.js
64
+ var f = w(/[A-Za-z]/), p = w(/[\dA-Za-z]/), m = w(/[#-'*+\--9=?A-Z^-~]/);
65
+ function h(e) {
66
+ return e !== null && (e < 32 || e === 127);
67
+ }
68
+ var g = w(/\d/), _ = w(/[\dA-Fa-f]/), v = w(/[!-/:-@[-`{-~]/);
69
+ function y(e) {
70
+ return e !== null && e < -2;
71
+ }
72
+ function b(e) {
73
+ return e !== null && (e < 0 || e === 32);
74
+ }
75
+ function x(e) {
76
+ return e === -2 || e === -1 || e === 32;
77
+ }
78
+ var S = w(/\p{P}|\p{S}/u), C = w(/\s/);
79
+ function w(e) {
80
+ return t;
81
+ function t(t) {
82
+ return t !== null && t > -1 && e.test(String.fromCharCode(t));
83
+ }
84
+ }
85
+ //#endregion
86
+ //#region node_modules/micromark-factory-space/index.js
87
+ function T(e, t, n, r) {
88
+ let i = r ? r - 1 : Infinity, a = 0;
89
+ return o;
90
+ function o(r) {
91
+ return x(r) ? (e.enter(n), s(r)) : t(r);
92
+ }
93
+ function s(r) {
94
+ return x(r) && a++ < i ? (e.consume(r), s) : (e.exit(n), t(r));
95
+ }
96
+ }
97
+ //#endregion
98
+ //#region node_modules/micromark-util-classify-character/index.js
99
+ function E(e) {
100
+ if (e === null || b(e) || C(e)) return 1;
101
+ if (S(e)) return 2;
102
+ }
103
+ //#endregion
104
+ //#region node_modules/micromark-util-resolve-all/index.js
105
+ function D(e, t, n) {
106
+ let r = [], i = -1;
107
+ for (; ++i < e.length;) {
108
+ let a = e[i].resolveAll;
109
+ a && !r.includes(a) && (t = a(t, n), r.push(a));
110
+ }
111
+ return t;
112
+ }
113
+ //#endregion
114
+ //#region node_modules/micromark-core-commonmark/lib/blank-line.js
115
+ var O = {
116
+ partial: !0,
117
+ tokenize: k
118
+ };
119
+ function k(e, t, n) {
120
+ return r;
121
+ function r(t) {
122
+ return x(t) ? T(e, i, "linePrefix")(t) : i(t);
123
+ }
124
+ function i(e) {
125
+ return e === null || y(e) ? t(e) : n(e);
126
+ }
127
+ }
128
+ //#endregion
129
+ export { d as _, f as a, a as b, h as c, v as d, y as f, C as g, S as h, T as i, g as l, x as m, D as n, p as o, b as p, E as r, m as s, O as t, _ as u, c as v, t as x, o as y };