hermium 0.1.9 → 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 +56 -0
- package/bin/hermium.mjs +185 -164
- package/dist/api.mjs +3513 -0
- package/dist/public/assets/css/index-Dfs9RUU9.css +1 -0
- package/dist/public/assets/css/styles-B8p6jk5Z.css +1 -0
- package/dist/public/assets/js/ChatInputBlock-Bw7AL70H.js +1 -0
- package/dist/public/assets/js/MarkdownMessage-8d7Y6VL-.js +1 -0
- package/dist/public/assets/js/base-ui-BvQbAt_1.js +1 -0
- package/dist/public/assets/js/chat._sessionId-BG6lVraH.js +1 -0
- package/dist/public/assets/js/chat.index-D2zdMPTT.js +1 -0
- package/dist/public/assets/js/index-C0AK45FU.js +60 -0
- package/dist/public/assets/js/index-Cx5En4FK.js +1 -0
- package/dist/public/assets/js/memory-CeSRdTkW.js +3 -0
- package/dist/public/assets/js/router-8uDKazL-.js +1 -0
- package/dist/public/assets/js/settings-Bc3Y5zXO.js +1 -0
- package/dist/public/assets/js/skills-DZv7sA_5.js +1 -0
- package/dist/public/assets/js/theme-CPkdkpaj.js +1 -0
- package/dist/public/assets/js/usage-DXQsT9_b.js +1 -0
- package/dist/public/assets/woff2/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/public/assets/woff2/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/public/assets/woff2/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/public/assets/woff2/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/public/assets/woff2/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/logo.png +0 -0
- package/package.json +1 -1
- package/dist/public/assets/IconAlertCircle-BHkmI3j7.js +0 -1
- package/dist/public/assets/IconAlertTriangle-wCJudlVg.js +0 -1
- package/dist/public/assets/IconCheck-CFuEh_p7.js +0 -1
- package/dist/public/assets/IconLoader2-BIx3OuF9.js +0 -1
- package/dist/public/assets/IconRefresh-Dgm93w3T.js +0 -1
- package/dist/public/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/public/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/public/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/public/assets/index-Bbz3abmO.js +0 -14
- package/dist/public/assets/index-CWUaRwcE.js +0 -1
- package/dist/public/assets/index-CinLq3cd.js +0 -1
- package/dist/public/assets/index-CrQs9n6q.js +0 -29
- package/dist/public/assets/index-CtacpN3I.js +0 -1
- package/dist/public/assets/index-DY7aE-9s.js +0 -2
- package/dist/public/assets/index-DkYGodJj.js +0 -94
- package/dist/public/assets/index-DvDLadUx.js +0 -1
- package/dist/public/assets/index-U6RcWedt.js +0 -1
- package/dist/public/assets/index-_6iFZ0fh.js +0 -1
- package/dist/public/assets/index-enFS26SU.js +0 -1
- package/dist/public/assets/input-eNcwlDHp.js +0 -1
- package/dist/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/public/assets/queries-iHRgZzw2.js +0 -1
- package/dist/public/assets/styles-KcflDlA_.css +0 -1
- package/dist/public/assets/switch-B1DcZLwL.js +0 -1
- package/dist/public/assets/syntax-highlighter-DWPF-A_h.js +0 -6
- package/dist/public/assets/textarea-Di_syYTS.js +0 -1
- package/dist/public/favicon.png +0 -0
- package/dist/public/nous-logo.png +0 -0
- package/dist/server/index.mjs +0 -244
- package/dist/web-server/__23tanstack-start-plugin-adapters-Cwee5PKy.mjs +0 -6
- package/dist/web-server/_chunks/ssr-renderer.mjs +0 -22
- package/dist/web-server/_libs/babel__runtime.mjs +0 -237
- package/dist/web-server/_libs/bail.mjs +0 -8
- package/dist/web-server/_libs/base-ui__react.mjs +0 -9554
- package/dist/web-server/_libs/base-ui__utils.mjs +0 -1101
- package/dist/web-server/_libs/ccount.mjs +0 -16
- package/dist/web-server/_libs/character-entities-legacy.mjs +0 -111
- package/dist/web-server/_libs/character-entities.mjs +0 -2130
- package/dist/web-server/_libs/character-reference-invalid.mjs +0 -33
- package/dist/web-server/_libs/class-variance-authority.mjs +0 -44
- package/dist/web-server/_libs/clsx.mjs +0 -16
- package/dist/web-server/_libs/comma-separated-tokens.mjs +0 -31
- package/dist/web-server/_libs/cookie-es.mjs +0 -44
- package/dist/web-server/_libs/croner.mjs +0 -1
- package/dist/web-server/_libs/crossws.mjs +0 -1
- package/dist/web-server/_libs/decode-named-character-reference+[...].mjs +0 -8
- package/dist/web-server/_libs/devlop.mjs +0 -8
- package/dist/web-server/_libs/escape-string-regexp.mjs +0 -9
- package/dist/web-server/_libs/estree-util-is-identifier-name.mjs +0 -11
- package/dist/web-server/_libs/extend.mjs +0 -97
- package/dist/web-server/_libs/fault.mjs +0 -1
- package/dist/web-server/_libs/floating-ui__core.mjs +0 -663
- package/dist/web-server/_libs/floating-ui__dom.mjs +0 -624
- package/dist/web-server/_libs/floating-ui__react-dom.mjs +0 -279
- package/dist/web-server/_libs/floating-ui__utils.mjs +0 -322
- package/dist/web-server/_libs/format.mjs +0 -1
- package/dist/web-server/_libs/h3.mjs +0 -408
- package/dist/web-server/_libs/hast-util-parse-selector.mjs +0 -39
- package/dist/web-server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
- package/dist/web-server/_libs/hast-util-whitespace.mjs +0 -10
- package/dist/web-server/_libs/hastscript.mjs +0 -200
- package/dist/web-server/_libs/highlight.js.mjs +0 -1
- package/dist/web-server/_libs/hookable.mjs +0 -1
- package/dist/web-server/_libs/html-url-attributes.mjs +0 -26
- package/dist/web-server/_libs/inline-style-parser.mjs +0 -142
- package/dist/web-server/_libs/is-alphabetical.mjs +0 -7
- package/dist/web-server/_libs/is-alphanumerical.mjs +0 -8
- package/dist/web-server/_libs/is-decimal.mjs +0 -7
- package/dist/web-server/_libs/is-hexadecimal.mjs +0 -7
- package/dist/web-server/_libs/is-plain-obj.mjs +0 -10
- package/dist/web-server/_libs/isbot.mjs +0 -21
- package/dist/web-server/_libs/longest-streak.mjs +0 -25
- package/dist/web-server/_libs/lowlight.mjs +0 -1
- package/dist/web-server/_libs/markdown-table.mjs +0 -142
- package/dist/web-server/_libs/mdast-util-find-and-replace.mjs +0 -109
- package/dist/web-server/_libs/mdast-util-from-markdown.mjs +0 -717
- package/dist/web-server/_libs/mdast-util-gfm-autolink-literal+[...].mjs +0 -156
- package/dist/web-server/_libs/mdast-util-gfm-footnote.mjs +0 -117
- package/dist/web-server/_libs/mdast-util-gfm-strikethrough.mjs +0 -54
- package/dist/web-server/_libs/mdast-util-gfm-table.mjs +0 -157
- package/dist/web-server/_libs/mdast-util-gfm-task-list-item.mjs +0 -77
- package/dist/web-server/_libs/mdast-util-gfm.mjs +0 -29
- package/dist/web-server/_libs/mdast-util-phrasing.mjs +0 -30
- package/dist/web-server/_libs/mdast-util-to-hast.mjs +0 -710
- package/dist/web-server/_libs/mdast-util-to-markdown.mjs +0 -798
- package/dist/web-server/_libs/mdast-util-to-string.mjs +0 -38
- package/dist/web-server/_libs/micromark-core-commonmark.mjs +0 -2259
- package/dist/web-server/_libs/micromark-extension-gfm-autolink-literal+[...].mjs +0 -344
- package/dist/web-server/_libs/micromark-extension-gfm-footnote+[...].mjs +0 -279
- package/dist/web-server/_libs/micromark-extension-gfm-strikethrough+[...].mjs +0 -98
- package/dist/web-server/_libs/micromark-extension-gfm-table.mjs +0 -491
- package/dist/web-server/_libs/micromark-extension-gfm-tagfilter+[...].mjs +0 -1
- package/dist/web-server/_libs/micromark-extension-gfm-task-list-item+[...].mjs +0 -77
- package/dist/web-server/_libs/micromark-extension-gfm.mjs +0 -18
- package/dist/web-server/_libs/micromark-factory-destination.mjs +0 -94
- package/dist/web-server/_libs/micromark-factory-label.mjs +0 -63
- package/dist/web-server/_libs/micromark-factory-space.mjs +0 -24
- package/dist/web-server/_libs/micromark-factory-title.mjs +0 -65
- package/dist/web-server/_libs/micromark-factory-whitespace.mjs +0 -22
- package/dist/web-server/_libs/micromark-util-character.mjs +0 -44
- package/dist/web-server/_libs/micromark-util-chunked.mjs +0 -36
- package/dist/web-server/_libs/micromark-util-classify-character+[...].mjs +0 -12
- package/dist/web-server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
- package/dist/web-server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
- package/dist/web-server/_libs/micromark-util-decode-string.mjs +0 -21
- package/dist/web-server/_libs/micromark-util-encode.mjs +0 -1
- package/dist/web-server/_libs/micromark-util-html-tag-name.mjs +0 -69
- package/dist/web-server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
- package/dist/web-server/_libs/micromark-util-resolve-all.mjs +0 -15
- package/dist/web-server/_libs/micromark-util-sanitize-uri.mjs +0 -41
- package/dist/web-server/_libs/micromark-util-subtokenize.mjs +0 -346
- package/dist/web-server/_libs/micromark.mjs +0 -906
- package/dist/web-server/_libs/ocache.mjs +0 -1
- package/dist/web-server/_libs/ohash.mjs +0 -1
- package/dist/web-server/_libs/parse-entities.mjs +0 -245
- package/dist/web-server/_libs/property-information.mjs +0 -1210
- package/dist/web-server/_libs/react-dom.mjs +0 -10779
- package/dist/web-server/_libs/react-markdown.mjs +0 -147
- package/dist/web-server/_libs/react-syntax-highlighter.mjs +0 -941
- package/dist/web-server/_libs/react.mjs +0 -513
- package/dist/web-server/_libs/refractor.mjs +0 -2425
- package/dist/web-server/_libs/remark-gfm.mjs +0 -20
- package/dist/web-server/_libs/remark-parse.mjs +0 -19
- package/dist/web-server/_libs/remark-rehype.mjs +0 -21
- package/dist/web-server/_libs/reselect.mjs +0 -1
- package/dist/web-server/_libs/rou3.mjs +0 -8
- package/dist/web-server/_libs/seroval-plugins.mjs +0 -58
- package/dist/web-server/_libs/seroval.mjs +0 -1775
- package/dist/web-server/_libs/space-separated-tokens.mjs +0 -11
- package/dist/web-server/_libs/srvx.mjs +0 -781
- package/dist/web-server/_libs/style-to-js.mjs +0 -72
- package/dist/web-server/_libs/style-to-object.mjs +0 -38
- package/dist/web-server/_libs/tabler__icons-react.mjs +0 -230
- package/dist/web-server/_libs/tanstack__history.mjs +0 -204
- package/dist/web-server/_libs/tanstack__query-core.mjs +0 -2552
- package/dist/web-server/_libs/tanstack__react-query.mjs +0 -190
- package/dist/web-server/_libs/tanstack__react-router.mjs +0 -1120
- package/dist/web-server/_libs/tanstack__react-store.mjs +0 -2
- package/dist/web-server/_libs/tanstack__router-core.mjs +0 -4288
- package/dist/web-server/_libs/tanstack__store.mjs +0 -1
- package/dist/web-server/_libs/trim-lines.mjs +0 -41
- package/dist/web-server/_libs/trough.mjs +0 -85
- package/dist/web-server/_libs/ufo.mjs +0 -54
- package/dist/web-server/_libs/unctx.mjs +0 -1
- package/dist/web-server/_libs/ungap__structured-clone.mjs +0 -224
- package/dist/web-server/_libs/unified.mjs +0 -661
- package/dist/web-server/_libs/unist-util-is.mjs +0 -100
- package/dist/web-server/_libs/unist-util-position.mjs +0 -27
- package/dist/web-server/_libs/unist-util-stringify-position.mjs +0 -27
- package/dist/web-server/_libs/unist-util-visit-parents.mjs +0 -83
- package/dist/web-server/_libs/unist-util-visit.mjs +0 -24
- package/dist/web-server/_libs/unstorage.mjs +0 -1
- package/dist/web-server/_libs/use-sync-external-store.mjs +0 -139
- package/dist/web-server/_libs/vfile-message.mjs +0 -138
- package/dist/web-server/_libs/vfile.mjs +0 -467
- package/dist/web-server/_libs/zod.mjs +0 -3915
- package/dist/web-server/_libs/zustand.mjs +0 -343
- package/dist/web-server/_libs/zwitch.mjs +0 -1
- package/dist/web-server/_ssr/index-0n2Z3BPQ.mjs +0 -369
- package/dist/web-server/_ssr/index-6itDALOw.mjs +0 -339
- package/dist/web-server/_ssr/index-BIRTrOmp.mjs +0 -449
- package/dist/web-server/_ssr/index-BPzfADac.mjs +0 -66
- package/dist/web-server/_ssr/index-BQE3bF14.mjs +0 -1870
- package/dist/web-server/_ssr/index-C5HpvlUP.mjs +0 -190
- package/dist/web-server/_ssr/index-C_ZxnypN.mjs +0 -213
- package/dist/web-server/_ssr/index-Ca8JFH8f.mjs +0 -612
- package/dist/web-server/_ssr/index-DNVESZiA.mjs +0 -513
- package/dist/web-server/_ssr/index.mjs +0 -1558
- package/dist/web-server/_ssr/input-CqXjTRQg.mjs +0 -20
- package/dist/web-server/_ssr/queries-3H_19mUt.mjs +0 -16
- package/dist/web-server/_ssr/router-sbsNus0Y.mjs +0 -2093
- package/dist/web-server/_ssr/start-HYkvq4Ni.mjs +0 -4
- package/dist/web-server/_ssr/switch-usf2F1UM.mjs +0 -33
- package/dist/web-server/_ssr/syntax-highlighter-5vezNTce.mjs +0 -62
- package/dist/web-server/_ssr/textarea-DfRheWY0.mjs +0 -18
- package/dist/web-server/_tanstack-start-manifest_v-DqW-pKEH.mjs +0 -4
- package/dist/web-server/index.mjs +0 -597
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { s as splice } from "./micromark-util-chunked.mjs";
|
|
2
|
-
import { c as classifyCharacter } from "./micromark-util-classify-character+[...].mjs";
|
|
3
|
-
import { r as resolveAll } from "./micromark-util-resolve-all.mjs";
|
|
4
|
-
function gfmStrikethrough(options) {
|
|
5
|
-
const options_ = options || {};
|
|
6
|
-
let single = options_.singleTilde;
|
|
7
|
-
const tokenizer = {
|
|
8
|
-
name: "strikethrough",
|
|
9
|
-
tokenize: tokenizeStrikethrough,
|
|
10
|
-
resolveAll: resolveAllStrikethrough
|
|
11
|
-
};
|
|
12
|
-
if (single === null || single === void 0) {
|
|
13
|
-
single = true;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
text: {
|
|
17
|
-
[126]: tokenizer
|
|
18
|
-
},
|
|
19
|
-
insideSpan: {
|
|
20
|
-
null: [tokenizer]
|
|
21
|
-
},
|
|
22
|
-
attentionMarkers: {
|
|
23
|
-
null: [126]
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
function resolveAllStrikethrough(events, context) {
|
|
27
|
-
let index = -1;
|
|
28
|
-
while (++index < events.length) {
|
|
29
|
-
if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) {
|
|
30
|
-
let open = index;
|
|
31
|
-
while (open--) {
|
|
32
|
-
if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && // If the sizes are the same:
|
|
33
|
-
events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {
|
|
34
|
-
events[index][1].type = "strikethroughSequence";
|
|
35
|
-
events[open][1].type = "strikethroughSequence";
|
|
36
|
-
const strikethrough = {
|
|
37
|
-
type: "strikethrough",
|
|
38
|
-
start: Object.assign({}, events[open][1].start),
|
|
39
|
-
end: Object.assign({}, events[index][1].end)
|
|
40
|
-
};
|
|
41
|
-
const text = {
|
|
42
|
-
type: "strikethroughText",
|
|
43
|
-
start: Object.assign({}, events[open][1].end),
|
|
44
|
-
end: Object.assign({}, events[index][1].start)
|
|
45
|
-
};
|
|
46
|
-
const nextEvents = [["enter", strikethrough, context], ["enter", events[open][1], context], ["exit", events[open][1], context], ["enter", text, context]];
|
|
47
|
-
const insideSpan = context.parser.constructs.insideSpan.null;
|
|
48
|
-
if (insideSpan) {
|
|
49
|
-
splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));
|
|
50
|
-
}
|
|
51
|
-
splice(nextEvents, nextEvents.length, 0, [["exit", text, context], ["enter", events[index][1], context], ["exit", events[index][1], context], ["exit", strikethrough, context]]);
|
|
52
|
-
splice(events, open - 1, index - open + 3, nextEvents);
|
|
53
|
-
index = open + nextEvents.length - 2;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
index = -1;
|
|
60
|
-
while (++index < events.length) {
|
|
61
|
-
if (events[index][1].type === "strikethroughSequenceTemporary") {
|
|
62
|
-
events[index][1].type = "data";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return events;
|
|
66
|
-
}
|
|
67
|
-
function tokenizeStrikethrough(effects, ok, nok) {
|
|
68
|
-
const previous = this.previous;
|
|
69
|
-
const events = this.events;
|
|
70
|
-
let size = 0;
|
|
71
|
-
return start;
|
|
72
|
-
function start(code) {
|
|
73
|
-
if (previous === 126 && events[events.length - 1][1].type !== "characterEscape") {
|
|
74
|
-
return nok(code);
|
|
75
|
-
}
|
|
76
|
-
effects.enter("strikethroughSequenceTemporary");
|
|
77
|
-
return more(code);
|
|
78
|
-
}
|
|
79
|
-
function more(code) {
|
|
80
|
-
const before = classifyCharacter(previous);
|
|
81
|
-
if (code === 126) {
|
|
82
|
-
if (size > 1) return nok(code);
|
|
83
|
-
effects.consume(code);
|
|
84
|
-
size++;
|
|
85
|
-
return more;
|
|
86
|
-
}
|
|
87
|
-
if (size < 2 && !single) return nok(code);
|
|
88
|
-
const token = effects.exit("strikethroughSequenceTemporary");
|
|
89
|
-
const after = classifyCharacter(code);
|
|
90
|
-
token._open = !after || after === 2 && Boolean(before);
|
|
91
|
-
token._close = !before || before === 2 && Boolean(after);
|
|
92
|
-
return ok(code);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
export {
|
|
97
|
-
gfmStrikethrough as g
|
|
98
|
-
};
|
|
@@ -1,491 +0,0 @@
|
|
|
1
|
-
import { f as factorySpace } from "./micromark-factory-space.mjs";
|
|
2
|
-
import { m as markdownLineEnding, b as markdownSpace, c as markdownLineEndingOrSpace } from "./micromark-util-character.mjs";
|
|
3
|
-
class EditMap {
|
|
4
|
-
/**
|
|
5
|
-
* Create a new edit map.
|
|
6
|
-
*/
|
|
7
|
-
constructor() {
|
|
8
|
-
this.map = [];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Create an edit: a remove and/or add at a certain place.
|
|
12
|
-
*
|
|
13
|
-
* @param {number} index
|
|
14
|
-
* @param {number} remove
|
|
15
|
-
* @param {Array<Event>} add
|
|
16
|
-
* @returns {undefined}
|
|
17
|
-
*/
|
|
18
|
-
add(index, remove, add) {
|
|
19
|
-
addImplementation(this, index, remove, add);
|
|
20
|
-
}
|
|
21
|
-
// To do: add this when moving to `micromark`.
|
|
22
|
-
// /**
|
|
23
|
-
// * Create an edit: but insert `add` before existing additions.
|
|
24
|
-
// *
|
|
25
|
-
// * @param {number} index
|
|
26
|
-
// * @param {number} remove
|
|
27
|
-
// * @param {Array<Event>} add
|
|
28
|
-
// * @returns {undefined}
|
|
29
|
-
// */
|
|
30
|
-
// addBefore(index, remove, add) {
|
|
31
|
-
// addImplementation(this, index, remove, add, true)
|
|
32
|
-
// }
|
|
33
|
-
/**
|
|
34
|
-
* Done, change the events.
|
|
35
|
-
*
|
|
36
|
-
* @param {Array<Event>} events
|
|
37
|
-
* @returns {undefined}
|
|
38
|
-
*/
|
|
39
|
-
consume(events) {
|
|
40
|
-
this.map.sort(function(a, b) {
|
|
41
|
-
return a[0] - b[0];
|
|
42
|
-
});
|
|
43
|
-
if (this.map.length === 0) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
let index = this.map.length;
|
|
47
|
-
const vecs = [];
|
|
48
|
-
while (index > 0) {
|
|
49
|
-
index -= 1;
|
|
50
|
-
vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);
|
|
51
|
-
events.length = this.map[index][0];
|
|
52
|
-
}
|
|
53
|
-
vecs.push(events.slice());
|
|
54
|
-
events.length = 0;
|
|
55
|
-
let slice = vecs.pop();
|
|
56
|
-
while (slice) {
|
|
57
|
-
for (const element of slice) {
|
|
58
|
-
events.push(element);
|
|
59
|
-
}
|
|
60
|
-
slice = vecs.pop();
|
|
61
|
-
}
|
|
62
|
-
this.map.length = 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function addImplementation(editMap, at, remove, add) {
|
|
66
|
-
let index = 0;
|
|
67
|
-
if (remove === 0 && add.length === 0) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
while (index < editMap.map.length) {
|
|
71
|
-
if (editMap.map[index][0] === at) {
|
|
72
|
-
editMap.map[index][1] += remove;
|
|
73
|
-
editMap.map[index][2].push(...add);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
index += 1;
|
|
77
|
-
}
|
|
78
|
-
editMap.map.push([at, remove, add]);
|
|
79
|
-
}
|
|
80
|
-
function gfmTableAlign(events, index) {
|
|
81
|
-
let inDelimiterRow = false;
|
|
82
|
-
const align = [];
|
|
83
|
-
while (index < events.length) {
|
|
84
|
-
const event = events[index];
|
|
85
|
-
if (inDelimiterRow) {
|
|
86
|
-
if (event[0] === "enter") {
|
|
87
|
-
if (event[1].type === "tableContent") {
|
|
88
|
-
align.push(events[index + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
|
|
89
|
-
}
|
|
90
|
-
} else if (event[1].type === "tableContent") {
|
|
91
|
-
if (events[index - 1][1].type === "tableDelimiterMarker") {
|
|
92
|
-
const alignIndex = align.length - 1;
|
|
93
|
-
align[alignIndex] = align[alignIndex] === "left" ? "center" : "right";
|
|
94
|
-
}
|
|
95
|
-
} else if (event[1].type === "tableDelimiterRow") {
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
} else if (event[0] === "enter" && event[1].type === "tableDelimiterRow") {
|
|
99
|
-
inDelimiterRow = true;
|
|
100
|
-
}
|
|
101
|
-
index += 1;
|
|
102
|
-
}
|
|
103
|
-
return align;
|
|
104
|
-
}
|
|
105
|
-
function gfmTable() {
|
|
106
|
-
return {
|
|
107
|
-
flow: {
|
|
108
|
-
null: {
|
|
109
|
-
name: "table",
|
|
110
|
-
tokenize: tokenizeTable,
|
|
111
|
-
resolveAll: resolveTable
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function tokenizeTable(effects, ok, nok) {
|
|
117
|
-
const self = this;
|
|
118
|
-
let size = 0;
|
|
119
|
-
let sizeB = 0;
|
|
120
|
-
let seen;
|
|
121
|
-
return start;
|
|
122
|
-
function start(code) {
|
|
123
|
-
let index = self.events.length - 1;
|
|
124
|
-
while (index > -1) {
|
|
125
|
-
const type = self.events[index][1].type;
|
|
126
|
-
if (type === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
|
|
127
|
-
type === "linePrefix") index--;
|
|
128
|
-
else break;
|
|
129
|
-
}
|
|
130
|
-
const tail = index > -1 ? self.events[index][1].type : null;
|
|
131
|
-
const next = tail === "tableHead" || tail === "tableRow" ? bodyRowStart : headRowBefore;
|
|
132
|
-
if (next === bodyRowStart && self.parser.lazy[self.now().line]) {
|
|
133
|
-
return nok(code);
|
|
134
|
-
}
|
|
135
|
-
return next(code);
|
|
136
|
-
}
|
|
137
|
-
function headRowBefore(code) {
|
|
138
|
-
effects.enter("tableHead");
|
|
139
|
-
effects.enter("tableRow");
|
|
140
|
-
return headRowStart(code);
|
|
141
|
-
}
|
|
142
|
-
function headRowStart(code) {
|
|
143
|
-
if (code === 124) {
|
|
144
|
-
return headRowBreak(code);
|
|
145
|
-
}
|
|
146
|
-
seen = true;
|
|
147
|
-
sizeB += 1;
|
|
148
|
-
return headRowBreak(code);
|
|
149
|
-
}
|
|
150
|
-
function headRowBreak(code) {
|
|
151
|
-
if (code === null) {
|
|
152
|
-
return nok(code);
|
|
153
|
-
}
|
|
154
|
-
if (markdownLineEnding(code)) {
|
|
155
|
-
if (sizeB > 1) {
|
|
156
|
-
sizeB = 0;
|
|
157
|
-
self.interrupt = true;
|
|
158
|
-
effects.exit("tableRow");
|
|
159
|
-
effects.enter("lineEnding");
|
|
160
|
-
effects.consume(code);
|
|
161
|
-
effects.exit("lineEnding");
|
|
162
|
-
return headDelimiterStart;
|
|
163
|
-
}
|
|
164
|
-
return nok(code);
|
|
165
|
-
}
|
|
166
|
-
if (markdownSpace(code)) {
|
|
167
|
-
return factorySpace(effects, headRowBreak, "whitespace")(code);
|
|
168
|
-
}
|
|
169
|
-
sizeB += 1;
|
|
170
|
-
if (seen) {
|
|
171
|
-
seen = false;
|
|
172
|
-
size += 1;
|
|
173
|
-
}
|
|
174
|
-
if (code === 124) {
|
|
175
|
-
effects.enter("tableCellDivider");
|
|
176
|
-
effects.consume(code);
|
|
177
|
-
effects.exit("tableCellDivider");
|
|
178
|
-
seen = true;
|
|
179
|
-
return headRowBreak;
|
|
180
|
-
}
|
|
181
|
-
effects.enter("data");
|
|
182
|
-
return headRowData(code);
|
|
183
|
-
}
|
|
184
|
-
function headRowData(code) {
|
|
185
|
-
if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {
|
|
186
|
-
effects.exit("data");
|
|
187
|
-
return headRowBreak(code);
|
|
188
|
-
}
|
|
189
|
-
effects.consume(code);
|
|
190
|
-
return code === 92 ? headRowEscape : headRowData;
|
|
191
|
-
}
|
|
192
|
-
function headRowEscape(code) {
|
|
193
|
-
if (code === 92 || code === 124) {
|
|
194
|
-
effects.consume(code);
|
|
195
|
-
return headRowData;
|
|
196
|
-
}
|
|
197
|
-
return headRowData(code);
|
|
198
|
-
}
|
|
199
|
-
function headDelimiterStart(code) {
|
|
200
|
-
self.interrupt = false;
|
|
201
|
-
if (self.parser.lazy[self.now().line]) {
|
|
202
|
-
return nok(code);
|
|
203
|
-
}
|
|
204
|
-
effects.enter("tableDelimiterRow");
|
|
205
|
-
seen = false;
|
|
206
|
-
if (markdownSpace(code)) {
|
|
207
|
-
return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code);
|
|
208
|
-
}
|
|
209
|
-
return headDelimiterBefore(code);
|
|
210
|
-
}
|
|
211
|
-
function headDelimiterBefore(code) {
|
|
212
|
-
if (code === 45 || code === 58) {
|
|
213
|
-
return headDelimiterValueBefore(code);
|
|
214
|
-
}
|
|
215
|
-
if (code === 124) {
|
|
216
|
-
seen = true;
|
|
217
|
-
effects.enter("tableCellDivider");
|
|
218
|
-
effects.consume(code);
|
|
219
|
-
effects.exit("tableCellDivider");
|
|
220
|
-
return headDelimiterCellBefore;
|
|
221
|
-
}
|
|
222
|
-
return headDelimiterNok(code);
|
|
223
|
-
}
|
|
224
|
-
function headDelimiterCellBefore(code) {
|
|
225
|
-
if (markdownSpace(code)) {
|
|
226
|
-
return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code);
|
|
227
|
-
}
|
|
228
|
-
return headDelimiterValueBefore(code);
|
|
229
|
-
}
|
|
230
|
-
function headDelimiterValueBefore(code) {
|
|
231
|
-
if (code === 58) {
|
|
232
|
-
sizeB += 1;
|
|
233
|
-
seen = true;
|
|
234
|
-
effects.enter("tableDelimiterMarker");
|
|
235
|
-
effects.consume(code);
|
|
236
|
-
effects.exit("tableDelimiterMarker");
|
|
237
|
-
return headDelimiterLeftAlignmentAfter;
|
|
238
|
-
}
|
|
239
|
-
if (code === 45) {
|
|
240
|
-
sizeB += 1;
|
|
241
|
-
return headDelimiterLeftAlignmentAfter(code);
|
|
242
|
-
}
|
|
243
|
-
if (code === null || markdownLineEnding(code)) {
|
|
244
|
-
return headDelimiterCellAfter(code);
|
|
245
|
-
}
|
|
246
|
-
return headDelimiterNok(code);
|
|
247
|
-
}
|
|
248
|
-
function headDelimiterLeftAlignmentAfter(code) {
|
|
249
|
-
if (code === 45) {
|
|
250
|
-
effects.enter("tableDelimiterFiller");
|
|
251
|
-
return headDelimiterFiller(code);
|
|
252
|
-
}
|
|
253
|
-
return headDelimiterNok(code);
|
|
254
|
-
}
|
|
255
|
-
function headDelimiterFiller(code) {
|
|
256
|
-
if (code === 45) {
|
|
257
|
-
effects.consume(code);
|
|
258
|
-
return headDelimiterFiller;
|
|
259
|
-
}
|
|
260
|
-
if (code === 58) {
|
|
261
|
-
seen = true;
|
|
262
|
-
effects.exit("tableDelimiterFiller");
|
|
263
|
-
effects.enter("tableDelimiterMarker");
|
|
264
|
-
effects.consume(code);
|
|
265
|
-
effects.exit("tableDelimiterMarker");
|
|
266
|
-
return headDelimiterRightAlignmentAfter;
|
|
267
|
-
}
|
|
268
|
-
effects.exit("tableDelimiterFiller");
|
|
269
|
-
return headDelimiterRightAlignmentAfter(code);
|
|
270
|
-
}
|
|
271
|
-
function headDelimiterRightAlignmentAfter(code) {
|
|
272
|
-
if (markdownSpace(code)) {
|
|
273
|
-
return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code);
|
|
274
|
-
}
|
|
275
|
-
return headDelimiterCellAfter(code);
|
|
276
|
-
}
|
|
277
|
-
function headDelimiterCellAfter(code) {
|
|
278
|
-
if (code === 124) {
|
|
279
|
-
return headDelimiterBefore(code);
|
|
280
|
-
}
|
|
281
|
-
if (code === null || markdownLineEnding(code)) {
|
|
282
|
-
if (!seen || size !== sizeB) {
|
|
283
|
-
return headDelimiterNok(code);
|
|
284
|
-
}
|
|
285
|
-
effects.exit("tableDelimiterRow");
|
|
286
|
-
effects.exit("tableHead");
|
|
287
|
-
return ok(code);
|
|
288
|
-
}
|
|
289
|
-
return headDelimiterNok(code);
|
|
290
|
-
}
|
|
291
|
-
function headDelimiterNok(code) {
|
|
292
|
-
return nok(code);
|
|
293
|
-
}
|
|
294
|
-
function bodyRowStart(code) {
|
|
295
|
-
effects.enter("tableRow");
|
|
296
|
-
return bodyRowBreak(code);
|
|
297
|
-
}
|
|
298
|
-
function bodyRowBreak(code) {
|
|
299
|
-
if (code === 124) {
|
|
300
|
-
effects.enter("tableCellDivider");
|
|
301
|
-
effects.consume(code);
|
|
302
|
-
effects.exit("tableCellDivider");
|
|
303
|
-
return bodyRowBreak;
|
|
304
|
-
}
|
|
305
|
-
if (code === null || markdownLineEnding(code)) {
|
|
306
|
-
effects.exit("tableRow");
|
|
307
|
-
return ok(code);
|
|
308
|
-
}
|
|
309
|
-
if (markdownSpace(code)) {
|
|
310
|
-
return factorySpace(effects, bodyRowBreak, "whitespace")(code);
|
|
311
|
-
}
|
|
312
|
-
effects.enter("data");
|
|
313
|
-
return bodyRowData(code);
|
|
314
|
-
}
|
|
315
|
-
function bodyRowData(code) {
|
|
316
|
-
if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {
|
|
317
|
-
effects.exit("data");
|
|
318
|
-
return bodyRowBreak(code);
|
|
319
|
-
}
|
|
320
|
-
effects.consume(code);
|
|
321
|
-
return code === 92 ? bodyRowEscape : bodyRowData;
|
|
322
|
-
}
|
|
323
|
-
function bodyRowEscape(code) {
|
|
324
|
-
if (code === 92 || code === 124) {
|
|
325
|
-
effects.consume(code);
|
|
326
|
-
return bodyRowData;
|
|
327
|
-
}
|
|
328
|
-
return bodyRowData(code);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
function resolveTable(events, context) {
|
|
332
|
-
let index = -1;
|
|
333
|
-
let inFirstCellAwaitingPipe = true;
|
|
334
|
-
let rowKind = 0;
|
|
335
|
-
let lastCell = [0, 0, 0, 0];
|
|
336
|
-
let cell = [0, 0, 0, 0];
|
|
337
|
-
let afterHeadAwaitingFirstBodyRow = false;
|
|
338
|
-
let lastTableEnd = 0;
|
|
339
|
-
let currentTable;
|
|
340
|
-
let currentBody;
|
|
341
|
-
let currentCell;
|
|
342
|
-
const map = new EditMap();
|
|
343
|
-
while (++index < events.length) {
|
|
344
|
-
const event = events[index];
|
|
345
|
-
const token = event[1];
|
|
346
|
-
if (event[0] === "enter") {
|
|
347
|
-
if (token.type === "tableHead") {
|
|
348
|
-
afterHeadAwaitingFirstBodyRow = false;
|
|
349
|
-
if (lastTableEnd !== 0) {
|
|
350
|
-
flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
|
|
351
|
-
currentBody = void 0;
|
|
352
|
-
lastTableEnd = 0;
|
|
353
|
-
}
|
|
354
|
-
currentTable = {
|
|
355
|
-
type: "table",
|
|
356
|
-
start: Object.assign({}, token.start),
|
|
357
|
-
// Note: correct end is set later.
|
|
358
|
-
end: Object.assign({}, token.end)
|
|
359
|
-
};
|
|
360
|
-
map.add(index, 0, [["enter", currentTable, context]]);
|
|
361
|
-
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
362
|
-
inFirstCellAwaitingPipe = true;
|
|
363
|
-
currentCell = void 0;
|
|
364
|
-
lastCell = [0, 0, 0, 0];
|
|
365
|
-
cell = [0, index + 1, 0, 0];
|
|
366
|
-
if (afterHeadAwaitingFirstBodyRow) {
|
|
367
|
-
afterHeadAwaitingFirstBodyRow = false;
|
|
368
|
-
currentBody = {
|
|
369
|
-
type: "tableBody",
|
|
370
|
-
start: Object.assign({}, token.start),
|
|
371
|
-
// Note: correct end is set later.
|
|
372
|
-
end: Object.assign({}, token.end)
|
|
373
|
-
};
|
|
374
|
-
map.add(index, 0, [["enter", currentBody, context]]);
|
|
375
|
-
}
|
|
376
|
-
rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
|
|
377
|
-
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
378
|
-
inFirstCellAwaitingPipe = false;
|
|
379
|
-
if (cell[2] === 0) {
|
|
380
|
-
if (lastCell[1] !== 0) {
|
|
381
|
-
cell[0] = cell[1];
|
|
382
|
-
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
383
|
-
lastCell = [0, 0, 0, 0];
|
|
384
|
-
}
|
|
385
|
-
cell[2] = index;
|
|
386
|
-
}
|
|
387
|
-
} else if (token.type === "tableCellDivider") {
|
|
388
|
-
if (inFirstCellAwaitingPipe) {
|
|
389
|
-
inFirstCellAwaitingPipe = false;
|
|
390
|
-
} else {
|
|
391
|
-
if (lastCell[1] !== 0) {
|
|
392
|
-
cell[0] = cell[1];
|
|
393
|
-
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
394
|
-
}
|
|
395
|
-
lastCell = cell;
|
|
396
|
-
cell = [lastCell[1], index, 0, 0];
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
} else if (token.type === "tableHead") {
|
|
400
|
-
afterHeadAwaitingFirstBodyRow = true;
|
|
401
|
-
lastTableEnd = index;
|
|
402
|
-
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
403
|
-
lastTableEnd = index;
|
|
404
|
-
if (lastCell[1] !== 0) {
|
|
405
|
-
cell[0] = cell[1];
|
|
406
|
-
currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);
|
|
407
|
-
} else if (cell[1] !== 0) {
|
|
408
|
-
currentCell = flushCell(map, context, cell, rowKind, index, currentCell);
|
|
409
|
-
}
|
|
410
|
-
rowKind = 0;
|
|
411
|
-
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
412
|
-
cell[3] = index;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
if (lastTableEnd !== 0) {
|
|
416
|
-
flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
|
|
417
|
-
}
|
|
418
|
-
map.consume(context.events);
|
|
419
|
-
index = -1;
|
|
420
|
-
while (++index < context.events.length) {
|
|
421
|
-
const event = context.events[index];
|
|
422
|
-
if (event[0] === "enter" && event[1].type === "table") {
|
|
423
|
-
event[1]._align = gfmTableAlign(context.events, index);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return events;
|
|
427
|
-
}
|
|
428
|
-
function flushCell(map, context, range, rowKind, rowEnd, previousCell) {
|
|
429
|
-
const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
|
|
430
|
-
const valueName = "tableContent";
|
|
431
|
-
if (range[0] !== 0) {
|
|
432
|
-
previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
|
|
433
|
-
map.add(range[0], 0, [["exit", previousCell, context]]);
|
|
434
|
-
}
|
|
435
|
-
const now = getPoint(context.events, range[1]);
|
|
436
|
-
previousCell = {
|
|
437
|
-
type: groupName,
|
|
438
|
-
start: Object.assign({}, now),
|
|
439
|
-
// Note: correct end is set later.
|
|
440
|
-
end: Object.assign({}, now)
|
|
441
|
-
};
|
|
442
|
-
map.add(range[1], 0, [["enter", previousCell, context]]);
|
|
443
|
-
if (range[2] !== 0) {
|
|
444
|
-
const relatedStart = getPoint(context.events, range[2]);
|
|
445
|
-
const relatedEnd = getPoint(context.events, range[3]);
|
|
446
|
-
const valueToken = {
|
|
447
|
-
type: valueName,
|
|
448
|
-
start: Object.assign({}, relatedStart),
|
|
449
|
-
end: Object.assign({}, relatedEnd)
|
|
450
|
-
};
|
|
451
|
-
map.add(range[2], 0, [["enter", valueToken, context]]);
|
|
452
|
-
if (rowKind !== 2) {
|
|
453
|
-
const start = context.events[range[2]];
|
|
454
|
-
const end = context.events[range[3]];
|
|
455
|
-
start[1].end = Object.assign({}, end[1].end);
|
|
456
|
-
start[1].type = "chunkText";
|
|
457
|
-
start[1].contentType = "text";
|
|
458
|
-
if (range[3] > range[2] + 1) {
|
|
459
|
-
const a = range[2] + 1;
|
|
460
|
-
const b = range[3] - range[2] - 1;
|
|
461
|
-
map.add(a, b, []);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
map.add(range[3] + 1, 0, [["exit", valueToken, context]]);
|
|
465
|
-
}
|
|
466
|
-
if (rowEnd !== void 0) {
|
|
467
|
-
previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
|
|
468
|
-
map.add(rowEnd, 0, [["exit", previousCell, context]]);
|
|
469
|
-
previousCell = void 0;
|
|
470
|
-
}
|
|
471
|
-
return previousCell;
|
|
472
|
-
}
|
|
473
|
-
function flushTableEnd(map, context, index, table, tableBody) {
|
|
474
|
-
const exits = [];
|
|
475
|
-
const related = getPoint(context.events, index);
|
|
476
|
-
if (tableBody) {
|
|
477
|
-
tableBody.end = Object.assign({}, related);
|
|
478
|
-
exits.push(["exit", tableBody, context]);
|
|
479
|
-
}
|
|
480
|
-
table.end = Object.assign({}, related);
|
|
481
|
-
exits.push(["exit", table, context]);
|
|
482
|
-
map.add(index + 1, 0, exits);
|
|
483
|
-
}
|
|
484
|
-
function getPoint(events, index) {
|
|
485
|
-
const event = events[index];
|
|
486
|
-
const side = event[0] === "enter" ? "start" : "end";
|
|
487
|
-
return event[1][side];
|
|
488
|
-
}
|
|
489
|
-
export {
|
|
490
|
-
gfmTable as g
|
|
491
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { f as factorySpace } from "./micromark-factory-space.mjs";
|
|
2
|
-
import { c as markdownLineEndingOrSpace, m as markdownLineEnding, b as markdownSpace } from "./micromark-util-character.mjs";
|
|
3
|
-
const tasklistCheck = {
|
|
4
|
-
name: "tasklistCheck",
|
|
5
|
-
tokenize: tokenizeTasklistCheck
|
|
6
|
-
};
|
|
7
|
-
function gfmTaskListItem() {
|
|
8
|
-
return {
|
|
9
|
-
text: {
|
|
10
|
-
[91]: tasklistCheck
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function tokenizeTasklistCheck(effects, ok, nok) {
|
|
15
|
-
const self = this;
|
|
16
|
-
return open;
|
|
17
|
-
function open(code) {
|
|
18
|
-
if (
|
|
19
|
-
// Exit if there’s stuff before.
|
|
20
|
-
self.previous !== null || // Exit if not in the first content that is the first child of a list
|
|
21
|
-
// item.
|
|
22
|
-
!self._gfmTasklistFirstContentOfListItem
|
|
23
|
-
) {
|
|
24
|
-
return nok(code);
|
|
25
|
-
}
|
|
26
|
-
effects.enter("taskListCheck");
|
|
27
|
-
effects.enter("taskListCheckMarker");
|
|
28
|
-
effects.consume(code);
|
|
29
|
-
effects.exit("taskListCheckMarker");
|
|
30
|
-
return inside;
|
|
31
|
-
}
|
|
32
|
-
function inside(code) {
|
|
33
|
-
if (markdownLineEndingOrSpace(code)) {
|
|
34
|
-
effects.enter("taskListCheckValueUnchecked");
|
|
35
|
-
effects.consume(code);
|
|
36
|
-
effects.exit("taskListCheckValueUnchecked");
|
|
37
|
-
return close;
|
|
38
|
-
}
|
|
39
|
-
if (code === 88 || code === 120) {
|
|
40
|
-
effects.enter("taskListCheckValueChecked");
|
|
41
|
-
effects.consume(code);
|
|
42
|
-
effects.exit("taskListCheckValueChecked");
|
|
43
|
-
return close;
|
|
44
|
-
}
|
|
45
|
-
return nok(code);
|
|
46
|
-
}
|
|
47
|
-
function close(code) {
|
|
48
|
-
if (code === 93) {
|
|
49
|
-
effects.enter("taskListCheckMarker");
|
|
50
|
-
effects.consume(code);
|
|
51
|
-
effects.exit("taskListCheckMarker");
|
|
52
|
-
effects.exit("taskListCheck");
|
|
53
|
-
return after;
|
|
54
|
-
}
|
|
55
|
-
return nok(code);
|
|
56
|
-
}
|
|
57
|
-
function after(code) {
|
|
58
|
-
if (markdownLineEnding(code)) {
|
|
59
|
-
return ok(code);
|
|
60
|
-
}
|
|
61
|
-
if (markdownSpace(code)) {
|
|
62
|
-
return effects.check({
|
|
63
|
-
tokenize: spaceThenNonSpace
|
|
64
|
-
}, ok, nok)(code);
|
|
65
|
-
}
|
|
66
|
-
return nok(code);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function spaceThenNonSpace(effects, ok, nok) {
|
|
70
|
-
return factorySpace(effects, after, "whitespace");
|
|
71
|
-
function after(code) {
|
|
72
|
-
return code === null ? nok(code) : ok(code);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
export {
|
|
76
|
-
gfmTaskListItem as g
|
|
77
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { c as combineExtensions } from "./micromark-util-combine-extensions+[...].mjs";
|
|
2
|
-
import { g as gfmAutolinkLiteral } from "./micromark-extension-gfm-autolink-literal+[...].mjs";
|
|
3
|
-
import { g as gfmFootnote } from "./micromark-extension-gfm-footnote+[...].mjs";
|
|
4
|
-
import { g as gfmStrikethrough } from "./micromark-extension-gfm-strikethrough+[...].mjs";
|
|
5
|
-
import { g as gfmTable } from "./micromark-extension-gfm-table.mjs";
|
|
6
|
-
import { g as gfmTaskListItem } from "./micromark-extension-gfm-task-list-item+[...].mjs";
|
|
7
|
-
function gfm(options) {
|
|
8
|
-
return combineExtensions([
|
|
9
|
-
gfmAutolinkLiteral(),
|
|
10
|
-
gfmFootnote(),
|
|
11
|
-
gfmStrikethrough(options),
|
|
12
|
-
gfmTable(),
|
|
13
|
-
gfmTaskListItem()
|
|
14
|
-
]);
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
gfm as g
|
|
18
|
-
};
|