@tickernelz/paperclip-pro-server 2026.926.2 → 2026.926.3

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.
Files changed (106) hide show
  1. package/dist/build-info.json +1 -1
  2. package/dist/routes/agents.d.ts.map +1 -1
  3. package/dist/routes/agents.js +18 -4
  4. package/dist/routes/agents.js.map +1 -1
  5. package/dist/routes/issues.d.ts.map +1 -1
  6. package/dist/routes/issues.js +7 -0
  7. package/dist/routes/issues.js.map +1 -1
  8. package/dist/routes/openapi.d.ts.map +1 -1
  9. package/dist/routes/openapi.js +21 -8
  10. package/dist/routes/openapi.js.map +1 -1
  11. package/dist/routes/paperclip-mcp.d.ts.map +1 -1
  12. package/dist/routes/paperclip-mcp.js +23 -2
  13. package/dist/routes/paperclip-mcp.js.map +1 -1
  14. package/dist/services/issues.d.ts +5 -0
  15. package/dist/services/issues.d.ts.map +1 -1
  16. package/dist/services/issues.js +15 -1
  17. package/dist/services/issues.js.map +1 -1
  18. package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
  19. package/node_modules/micromark/dev/lib/compile.js +14 -4
  20. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
  21. package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
  22. package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
  23. package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
  24. package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
  25. package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
  26. package/node_modules/micromark/dev/lib/preprocess.js +19 -21
  27. package/node_modules/micromark/lib/compile.d.ts.map +1 -1
  28. package/node_modules/micromark/lib/compile.js +37 -29
  29. package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
  30. package/node_modules/micromark/lib/create-tokenizer.js +37 -35
  31. package/node_modules/micromark/lib/initialize/document.js +21 -13
  32. package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
  33. package/node_modules/micromark/lib/initialize/text.js +7 -3
  34. package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
  35. package/node_modules/micromark/lib/preprocess.js +16 -19
  36. package/node_modules/micromark/package.json +2 -15
  37. package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
  38. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
  39. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
  40. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
  41. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
  42. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
  43. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
  44. package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
  45. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
  46. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
  47. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
  48. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
  49. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
  50. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  51. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
  52. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
  53. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
  54. package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
  55. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
  56. package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
  57. package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
  58. package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
  59. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
  60. package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
  61. package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
  62. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
  63. package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
  64. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
  65. package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
  66. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
  67. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  68. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
  69. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
  70. package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
  71. package/node_modules/micromark-core-commonmark/package.json +4 -16
  72. package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
  73. package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
  74. package/node_modules/micromark-factory-space/dev/index.js +58 -3
  75. package/node_modules/micromark-factory-space/index.d.ts +24 -1
  76. package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
  77. package/node_modules/micromark-factory-space/index.js +55 -3
  78. package/node_modules/micromark-factory-space/package.json +1 -10
  79. package/node_modules/micromark-factory-space/readme.md +25 -25
  80. package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
  81. package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
  82. package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
  83. package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
  84. package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
  85. package/node_modules/micromark-util-edit-map/index.js +225 -0
  86. package/node_modules/micromark-util-edit-map/license +22 -0
  87. package/node_modules/micromark-util-edit-map/package.json +48 -0
  88. package/node_modules/micromark-util-edit-map/readme.md +234 -0
  89. package/node_modules/micromark-util-types/index.d.ts +6 -3
  90. package/node_modules/micromark-util-types/package.json +2 -36
  91. package/node_modules/ws/lib/websocket.js +17 -3
  92. package/node_modules/ws/package.json +1 -1
  93. package/package.json +20 -20
  94. package/skills/paperclip/references/api-reference.md +2 -2
  95. package/ui-dist/assets/{Agents.production-5Tba_pW_.js → Agents.production-BGeWxNtU.js} +2 -2
  96. package/ui-dist/assets/{CompanyActivity.production-CONFWTe1.js → CompanyActivity.production-9gzPo_M_.js} +1 -1
  97. package/ui-dist/assets/{CompanyExport-CiOVCS4y.js → CompanyExport-CwCAJj2l.js} +1 -1
  98. package/ui-dist/assets/{CompanySkills.production-gv4ej6PI.js → CompanySkills.production-CiTG4koz.js} +1 -1
  99. package/ui-dist/assets/{Costs.production-C6rOIGNV.js → Costs.production-CFn4Pjkh.js} +1 -1
  100. package/ui-dist/assets/{OrgChart.production-DYeuFtY_.js → OrgChart.production-U1cB4YS_.js} +1 -1
  101. package/ui-dist/assets/{RoutineDetail.production-Bt4IHfSD.js → RoutineDetail.production-oI3mHlKM.js} +1 -1
  102. package/ui-dist/assets/{Routines.production-BBxSwg2A.js → Routines.production-sl1FiAYd.js} +1 -1
  103. package/ui-dist/assets/{definition-B49KTmLW.js → definition-DrGsWdJY.js} +1 -1
  104. package/ui-dist/assets/{index-BRCs87uX.js → index-cwemnRTq.js} +144 -144
  105. package/ui-dist/index.html +1 -1
  106. package/ui-dist/sw.js +1 -1
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @import {
3
+ * Construct,
4
+ * State,
5
+ * TokenizeContext,
6
+ * Tokenizer
7
+ * } from 'micromark-util-types'
8
+ */
9
+
10
+ import {ok as assert} from 'devlop'
11
+ import {markdownLineEnding} from 'micromark-util-character'
12
+ import {codes, types} from 'micromark-util-symbol'
13
+
14
+ /** @type {Construct} */
15
+ export const nonLazyContinuation = {
16
+ partial: true,
17
+ tokenize: tokenizeNonLazyContinuation
18
+ }
19
+
20
+ /**
21
+ * @this {TokenizeContext}
22
+ * Context.
23
+ * @type {Tokenizer}
24
+ */
25
+ function tokenizeNonLazyContinuation(effects, ok, nok) {
26
+ const self = this
27
+
28
+ return start
29
+
30
+ /**
31
+ * At eol, before continuation.
32
+ *
33
+ * ```markdown
34
+ * > | * ```js
35
+ * ^
36
+ * | b
37
+ * ```
38
+ *
39
+ * @type {State}
40
+ */
41
+ function start(code) {
42
+ if (code === codes.eof) {
43
+ return nok(code)
44
+ }
45
+
46
+ assert(markdownLineEnding(code), 'expected eol')
47
+ effects.enter(types.lineEnding)
48
+ effects.consume(code)
49
+ effects.exit(types.lineEnding)
50
+ return after
51
+ }
52
+
53
+ /**
54
+ * A continuation.
55
+ *
56
+ * ```markdown
57
+ * | * ```js
58
+ * > | b
59
+ * ^
60
+ * ```
61
+ *
62
+ * @type {State}
63
+ */
64
+ function after(code) {
65
+ return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
66
+ }
67
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"setext-underline.d.ts","sourceRoot":"","sources":["setext-underline.js"],"names":[],"mappings":"AAgBA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAbS,sBAAsB"}
1
+ {"version":3,"file":"setext-underline.d.ts","sourceRoot":"","sources":["setext-underline.js"],"names":[],"mappings":"AAiBA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAdS,sBAAsB"}
@@ -12,6 +12,7 @@
12
12
  import {ok as assert} from 'devlop'
13
13
  import {factorySpace} from 'micromark-factory-space'
14
14
  import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
15
+ import {EditMap} from 'micromark-util-edit-map'
15
16
  import {codes, types} from 'micromark-util-symbol'
16
17
 
17
18
  /** @type {Construct} */
@@ -23,7 +24,7 @@ export const setextUnderline = {
23
24
 
24
25
  /** @type {Resolver} */
25
26
  function resolveToSetextUnderline(events, context) {
26
- // To do: resolve like `markdown-rs`.
27
+ const editMap = new EditMap()
27
28
  let index = events.length
28
29
  /** @type {number | undefined} */
29
30
  let content
@@ -49,7 +50,7 @@ function resolveToSetextUnderline(events, context) {
49
50
  else {
50
51
  if (events[index][1].type === types.content) {
51
52
  // Remove the content end (if needed we’ll add it later)
52
- events.splice(index, 1)
53
+ editMap.add(index, 1, [])
53
54
  }
54
55
 
55
56
  if (!definition && events[index][1].type === types.definition) {
@@ -77,15 +78,17 @@ function resolveToSetextUnderline(events, context) {
77
78
  // If we have definitions in the content, we’ll keep on having content,
78
79
  // but we need move it.
79
80
  if (definition) {
80
- events.splice(text, 0, ['enter', heading, context])
81
- events.splice(definition + 1, 0, ['exit', events[content][1], context])
81
+ editMap.add(text, 0, [['enter', heading, context]])
82
+ editMap.add(definition + 1, 0, [['exit', events[content][1], context]])
82
83
  events[content][1].end = {...events[definition][1].end}
83
84
  } else {
84
85
  events[content][1] = heading
85
86
  }
86
87
 
87
88
  // Add the heading exit at the end.
88
- events.push(['exit', heading, context])
89
+ editMap.add(events.length, 0, [['exit', heading, context]])
90
+
91
+ editMap.consume(events)
89
92
 
90
93
  return events
91
94
  }
@@ -30,22 +30,8 @@ export const attention = {
30
30
  // eslint-disable-next-line complexity
31
31
  function resolveAllAttention(events, context) {
32
32
  let index = -1;
33
- /** @type {number} */
34
- let open;
35
- /** @type {Token} */
36
- let group;
37
- /** @type {Token} */
38
- let text;
39
- /** @type {Token} */
40
- let openingSequence;
41
- /** @type {Token} */
42
- let closingSequence;
43
- /** @type {number} */
44
- let use;
45
33
  /** @type {Array<Event>} */
46
34
  let nextEvents;
47
- /** @type {number} */
48
- let offset;
49
35
 
50
36
  // Walk through all events.
51
37
  //
@@ -54,7 +40,7 @@ function resolveAllAttention(events, context) {
54
40
  while (++index < events.length) {
55
41
  // Find a token that can close.
56
42
  if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {
57
- open = index;
43
+ let open = index;
58
44
 
59
45
  // Now walk back to find an opener.
60
46
  while (open--) {
@@ -71,7 +57,7 @@ function resolveAllAttention(events, context) {
71
57
  }
72
58
 
73
59
  // Number of markers to use from the sequence.
74
- use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;
60
+ const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;
75
61
  const start = {
76
62
  ...events[open][1].end
77
63
  };
@@ -80,21 +66,21 @@ function resolveAllAttention(events, context) {
80
66
  };
81
67
  movePoint(start, -use);
82
68
  movePoint(end, use);
83
- openingSequence = {
69
+ const openingSequence = {
84
70
  type: use > 1 ? "strongSequence" : "emphasisSequence",
85
71
  start,
86
72
  end: {
87
73
  ...events[open][1].end
88
74
  }
89
75
  };
90
- closingSequence = {
76
+ const closingSequence = {
91
77
  type: use > 1 ? "strongSequence" : "emphasisSequence",
92
78
  start: {
93
79
  ...events[index][1].start
94
80
  },
95
81
  end
96
82
  };
97
- text = {
83
+ const text = {
98
84
  type: use > 1 ? "strongText" : "emphasisText",
99
85
  start: {
100
86
  ...events[open][1].end
@@ -103,7 +89,7 @@ function resolveAllAttention(events, context) {
103
89
  ...events[index][1].start
104
90
  }
105
91
  };
106
- group = {
92
+ const group = {
107
93
  type: use > 1 ? "strong" : "emphasis",
108
94
  start: {
109
95
  ...openingSequence.start
@@ -136,12 +122,13 @@ function resolveAllAttention(events, context) {
136
122
  // Closing.
137
123
  nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);
138
124
 
125
+ /** @type {number} */
126
+ let offset = 0;
127
+
139
128
  // If there are more markers in the closing, add them after.
140
129
  if (events[index][1].end.offset - events[index][1].start.offset) {
141
130
  offset = 2;
142
131
  nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);
143
- } else {
144
- offset = 0;
145
132
  }
146
133
  splice(events, open - 1, index - open + 3, nextEvents);
147
134
  index = open + nextEvents.length - offset - 2;
@@ -213,8 +200,11 @@ function tokenizeAttention(effects, ok) {
213
200
 
214
201
  // Always populated by defaults.
215
202
 
216
- const open = !after || after === 2 && before || attentionMarkers.includes(code);
217
- const close = !before || before === 2 && after || attentionMarkers.includes(previous);
203
+ // Note: `*` and `_` are in `attentionMarkers` through core.
204
+ // They are excluded here as the loosening is meant for markers registered
205
+ // by *other* constructs (such as GFM strikethrough’s `~`).
206
+ const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;
207
+ const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;
218
208
  token._open = Boolean(marker === 42 ? open : open && (before || !close));
219
209
  token._close = Boolean(marker === 42 ? close : close && (after || !open));
220
210
  return ok(code);
@@ -1 +1 @@
1
- {"version":3,"file":"code-fenced.d.ts","sourceRoot":"","sources":["code-fenced.js"],"names":[],"mappings":"AAqBA,wBAAwB;AACxB,yBADW,SAAS,CAKnB;+BAnBS,sBAAsB"}
1
+ {"version":3,"file":"code-fenced.d.ts","sourceRoot":"","sources":["code-fenced.js"],"names":[],"mappings":"AAgBA,wBAAwB;AACxB,yBADW,SAAS,CAKnB;+BAdS,sBAAsB"}
@@ -10,11 +10,7 @@
10
10
 
11
11
  import { factorySpace } from 'micromark-factory-space';
12
12
  import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
13
- /** @type {Construct} */
14
- const nonLazyContinuation = {
15
- partial: true,
16
- tokenize: tokenizeNonLazyContinuation
17
- };
13
+ import { nonLazyContinuation } from './partial-non-lazy-continuation.js';
18
14
 
19
15
  /** @type {Construct} */
20
16
  export const codeFenced = {
@@ -423,38 +419,4 @@ function tokenizeCodeFenced(effects, ok, nok) {
423
419
  return nok(code);
424
420
  }
425
421
  }
426
- }
427
-
428
- /**
429
- * @this {TokenizeContext}
430
- * Context.
431
- * @type {Tokenizer}
432
- */
433
- function tokenizeNonLazyContinuation(effects, ok, nok) {
434
- const self = this;
435
- return start;
436
-
437
- /**
438
- *
439
- *
440
- * @type {State}
441
- */
442
- function start(code) {
443
- if (code === null) {
444
- return nok(code);
445
- }
446
- effects.enter("lineEnding");
447
- effects.consume(code);
448
- effects.exit("lineEnding");
449
- return lineStart;
450
- }
451
-
452
- /**
453
- *
454
- *
455
- * @type {State}
456
- */
457
- function lineStart(code) {
458
- return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
459
- }
460
422
  }
@@ -7,7 +7,7 @@
7
7
  * } from 'micromark-util-types'
8
8
  */
9
9
 
10
- import { factorySpace } from 'micromark-factory-space';
10
+ import { factorySpaceMinMax } from 'micromark-factory-space';
11
11
  import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
12
12
  /** @type {Construct} */
13
13
  export const codeIndented = {
@@ -27,7 +27,6 @@ const furtherStart = {
27
27
  * @type {Tokenizer}
28
28
  */
29
29
  function tokenizeCodeIndented(effects, ok, nok) {
30
- const self = this;
31
30
  return start;
32
31
 
33
32
  /**
@@ -48,24 +47,7 @@ function tokenizeCodeIndented(effects, ok, nok) {
48
47
  // To do: manually check if interrupting like `markdown-rs`.
49
48
 
50
49
  effects.enter("codeIndented");
51
- // To do: use an improved `space_or_tab` function like `markdown-rs`,
52
- // so that we can drop the next state.
53
- return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code);
54
- }
55
-
56
- /**
57
- * At start, after 1 or 4 spaces.
58
- *
59
- * ```markdown
60
- * > | aaa
61
- * ^
62
- * ```
63
- *
64
- * @type {State}
65
- */
66
- function afterPrefix(code) {
67
- const tail = self.events[self.events.length - 1];
68
- return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code) : nok(code);
50
+ return factorySpaceMinMax(effects, atBreak, nok, "linePrefix", 4, 4)(code);
69
51
  }
70
52
 
71
53
  /**
@@ -154,24 +136,24 @@ function tokenizeFurtherStart(effects, ok, nok) {
154
136
  // To do: the code here in `micromark-js` is a bit different from
155
137
  // `markdown-rs` because there it can attempt spaces.
156
138
  // We can’t yet.
157
- //
158
- // To do: use an improved `space_or_tab` function like `markdown-rs`,
159
- // so that we can drop the next state.
160
- return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code);
139
+ return factorySpaceMinMax(effects, ok, onNotEnoughPrefix, "linePrefix", 4, 4)(code);
161
140
  }
162
141
 
163
142
  /**
164
- * At start, after 1 or 4 spaces.
143
+ * After not enough of a prefix.
144
+ *
145
+ * A following line ending is another (potentially blank) line to try,
146
+ * anything else means this isn’t a continuation.
165
147
  *
166
148
  * ```markdown
167
149
  * > | aaa
168
- * ^
150
+ *
151
+ * | bbb
169
152
  * ```
170
153
  *
171
154
  * @type {State}
172
155
  */
173
- function afterPrefix(code) {
174
- const tail = self.events[self.events.length - 1];
175
- return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? furtherStart(code) : nok(code);
156
+ function onNotEnoughPrefix(code) {
157
+ return markdownLineEnding(code) ? furtherStart(code) : nok(code);
176
158
  }
177
159
  }
@@ -23,10 +23,6 @@ export const headingAtx = {
23
23
  function resolveHeadingAtx(events, context) {
24
24
  let contentEnd = events.length - 2;
25
25
  let contentStart = 3;
26
- /** @type {Token} */
27
- let content;
28
- /** @type {Token} */
29
- let text;
30
26
 
31
27
  // Prefix whitespace, part of the opening.
32
28
  if (events[contentStart][1].type === "whitespace") {
@@ -41,12 +37,12 @@ function resolveHeadingAtx(events, context) {
41
37
  contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;
42
38
  }
43
39
  if (contentEnd > contentStart) {
44
- content = {
40
+ const content = {
45
41
  type: "atxHeadingText",
46
42
  start: events[contentStart][1].start,
47
43
  end: events[contentEnd][1].end
48
44
  };
49
- text = {
45
+ const text = {
50
46
  type: "chunkText",
51
47
  start: events[contentStart][1].start,
52
48
  end: events[contentEnd][1].end,
@@ -1 +1 @@
1
- {"version":3,"file":"html-flow.d.ts","sourceRoot":"","sources":["html-flow.js"],"names":[],"mappings":"AAuBA,wBAAwB;AACxB,uBADW,SAAS,CAMnB;+BArBS,sBAAsB"}
1
+ {"version":3,"file":"html-flow.d.ts","sourceRoot":"","sources":["html-flow.js"],"names":[],"mappings":"AAwBA,wBAAwB;AACxB,uBADW,SAAS,CAMnB;+BAtBS,sBAAsB"}
@@ -12,6 +12,7 @@
12
12
  import { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';
13
13
  import { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';
14
14
  import { blankLine } from './blank-line.js';
15
+ import { nonLazyContinuation } from './partial-non-lazy-continuation.js';
15
16
 
16
17
  /** @type {Construct} */
17
18
  export const htmlFlow = {
@@ -26,10 +27,6 @@ const blankLineBefore = {
26
27
  partial: true,
27
28
  tokenize: tokenizeBlankLineBefore
28
29
  };
29
- const nonLazyContinuationStart = {
30
- partial: true,
31
- tokenize: tokenizeNonLazyContinuationStart
32
- };
33
30
 
34
31
  /** @type {Resolver} */
35
32
  function resolveToHtmlFlow(events) {
@@ -608,7 +605,7 @@ function tokenizeHtmlFlow(effects, ok, nok) {
608
605
  * @type {State}
609
606
  */
610
607
  function continuationStart(code) {
611
- return effects.check(nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code);
608
+ return effects.check(nonLazyContinuation, continuationStartNonLazy, continuationAfter)(code);
612
609
  }
613
610
 
614
611
  /**
@@ -802,52 +799,6 @@ function tokenizeHtmlFlow(effects, ok, nok) {
802
799
  }
803
800
  }
804
801
 
805
- /**
806
- * @this {TokenizeContext}
807
- * Context.
808
- * @type {Tokenizer}
809
- */
810
- function tokenizeNonLazyContinuationStart(effects, ok, nok) {
811
- const self = this;
812
- return start;
813
-
814
- /**
815
- * At eol, before continuation.
816
- *
817
- * ```markdown
818
- * > | * ```js
819
- * ^
820
- * | b
821
- * ```
822
- *
823
- * @type {State}
824
- */
825
- function start(code) {
826
- if (markdownLineEnding(code)) {
827
- effects.enter("lineEnding");
828
- effects.consume(code);
829
- effects.exit("lineEnding");
830
- return after;
831
- }
832
- return nok(code);
833
- }
834
-
835
- /**
836
- * A continuation.
837
- *
838
- * ```markdown
839
- * | * ```js
840
- * > | b
841
- * ^
842
- * ```
843
- *
844
- * @type {State}
845
- */
846
- function after(code) {
847
- return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
848
- }
849
- }
850
-
851
802
  /**
852
803
  * @this {TokenizeContext}
853
804
  * Context.
@@ -66,8 +66,6 @@ function resolveAllLabelEnd(events) {
66
66
  function resolveToLabelEnd(events, context) {
67
67
  let index = events.length;
68
68
  let offset = 0;
69
- /** @type {Token} */
70
- let token;
71
69
  /** @type {number | undefined} */
72
70
  let open;
73
71
  /** @type {number | undefined} */
@@ -77,7 +75,7 @@ function resolveToLabelEnd(events, context) {
77
75
 
78
76
  // Find an opening.
79
77
  while (index--) {
80
- token = events[index][1];
78
+ const token = events[index][1];
81
79
  if (open) {
82
80
  // If we see another link, or inactive link label, we’ve been here before.
83
81
  if (token.type === "link" || token.type === "labelLink" && token._inactive) {
@@ -160,18 +158,18 @@ function resolveToLabelEnd(events, context) {
160
158
  */
161
159
  function tokenizeLabelEnd(effects, ok, nok) {
162
160
  const self = this;
163
- let index = self.events.length;
161
+ const labelStarts = self._labelStarts;
164
162
  /** @type {Token} */
165
163
  let labelStart;
166
164
  /** @type {boolean} */
167
165
  let defined;
168
-
169
- // Find an opening.
170
- while (index--) {
171
- if ((self.events[index][1].type === "labelImage" || self.events[index][1].type === "labelLink") && !self.events[index][1]._balanced) {
172
- labelStart = self.events[index][1];
173
- break;
166
+ if (labelStarts) {
167
+ // Discard ones that failed to close,
168
+ // they’re not needed anymore.
169
+ while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) {
170
+ labelStarts.pop();
174
171
  }
172
+ labelStart = labelStarts[labelStarts.length - 1];
175
173
  }
176
174
  return start;
177
175
 
@@ -290,6 +288,9 @@ function tokenizeLabelEnd(effects, ok, nok) {
290
288
  */
291
289
  function labelEndOk(code) {
292
290
  // Note: `markdown-rs` does a bunch of stuff here.
291
+ // This label start is now used up: discard it so it’s never found again.
292
+
293
+ labelStarts.pop();
293
294
  return ok(code);
294
295
  }
295
296
 
@@ -1 +1 @@
1
- {"version":3,"file":"label-start-image.d.ts","sourceRoot":"","sources":["label-start-image.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAZS,sBAAsB"}
1
+ {"version":3,"file":"label-start-image.d.ts","sourceRoot":"","sources":["label-start-image.js"],"names":[],"mappings":"AAcA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAZS,sBAAsB"}
@@ -2,6 +2,7 @@
2
2
  * @import {
3
3
  * Construct,
4
4
  * State,
5
+ * Token,
5
6
  * TokenizeContext,
6
7
  * Tokenizer
7
8
  * } from 'micromark-util-types'
@@ -23,6 +24,8 @@ export const labelStartImage = {
23
24
  */
24
25
  function tokenizeLabelStartImage(effects, ok, nok) {
25
26
  const self = this;
27
+ /** @type {Token} */
28
+ let labelImage;
26
29
  return start;
27
30
 
28
31
  /**
@@ -58,7 +61,7 @@ function tokenizeLabelStartImage(effects, ok, nok) {
58
61
  effects.enter("labelMarker");
59
62
  effects.consume(code);
60
63
  effects.exit("labelMarker");
61
- effects.exit("labelImage");
64
+ labelImage = effects.exit("labelImage");
62
65
  return after;
63
66
  }
64
67
  return nok(code);
@@ -96,7 +99,12 @@ function tokenizeLabelStartImage(effects, ok, nok) {
96
99
  // `micromark-extension-gfm-footnote`, but the `label-start-link`
97
100
  // behavior isn’t.
98
101
  // Hidden footnotes hook.
99
- /* c8 ignore next 3 */
100
- return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);
102
+ /* c8 ignore next 6 */
103
+ if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {
104
+ return nok(code);
105
+ }
106
+ self._labelStarts = self._labelStarts || [];
107
+ self._labelStarts.push(labelImage);
108
+ return ok(code);
101
109
  }
102
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"label-start-link.d.ts","sourceRoot":"","sources":["label-start-link.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,6BADW,SAAS,CAKnB;+BAZS,sBAAsB"}
1
+ {"version":3,"file":"label-start-link.d.ts","sourceRoot":"","sources":["label-start-link.js"],"names":[],"mappings":"AAcA,wBAAwB;AACxB,6BADW,SAAS,CAKnB;+BAZS,sBAAsB"}
@@ -2,6 +2,7 @@
2
2
  * @import {
3
3
  * Construct,
4
4
  * State,
5
+ * Token,
5
6
  * TokenizeContext,
6
7
  * Tokenizer
7
8
  * } from 'micromark-util-types'
@@ -23,6 +24,8 @@ export const labelStartLink = {
23
24
  */
24
25
  function tokenizeLabelStartLink(effects, ok, nok) {
25
26
  const self = this;
27
+ /** @type {Token} */
28
+ let labelLink;
26
29
  return start;
27
30
 
28
31
  /**
@@ -40,7 +43,7 @@ function tokenizeLabelStartLink(effects, ok, nok) {
40
43
  effects.enter("labelMarker");
41
44
  effects.consume(code);
42
45
  effects.exit("labelMarker");
43
- effects.exit("labelLink");
46
+ labelLink = effects.exit("labelLink");
44
47
  return after;
45
48
  }
46
49
 
@@ -49,7 +52,12 @@ function tokenizeLabelStartLink(effects, ok, nok) {
49
52
  // To do: this isn’t needed in `micromark-extension-gfm-footnote`,
50
53
  // remove.
51
54
  // Hidden footnotes hook.
52
- /* c8 ignore next 3 */
53
- return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);
55
+ /* c8 ignore next 6 */
56
+ if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {
57
+ return nok(code);
58
+ }
59
+ self._labelStarts = self._labelStarts || [];
60
+ self._labelStarts.push(labelLink);
61
+ return ok(code);
54
62
  }
55
63
  }
@@ -0,0 +1,4 @@
1
+ /** @type {Construct} */
2
+ export const nonLazyContinuation: Construct;
3
+ import type { Construct } from 'micromark-util-types';
4
+ //# sourceMappingURL=partial-non-lazy-continuation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial-non-lazy-continuation.d.ts","sourceRoot":"","sources":["partial-non-lazy-continuation.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,kCADW,SAAS,CAInB;+BAXS,sBAAsB"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @import {
3
+ * Construct,
4
+ * State,
5
+ * TokenizeContext,
6
+ * Tokenizer
7
+ * } from 'micromark-util-types'
8
+ */
9
+
10
+ import { markdownLineEnding } from 'micromark-util-character';
11
+ /** @type {Construct} */
12
+ export const nonLazyContinuation = {
13
+ partial: true,
14
+ tokenize: tokenizeNonLazyContinuation
15
+ };
16
+
17
+ /**
18
+ * @this {TokenizeContext}
19
+ * Context.
20
+ * @type {Tokenizer}
21
+ */
22
+ function tokenizeNonLazyContinuation(effects, ok, nok) {
23
+ const self = this;
24
+ return start;
25
+
26
+ /**
27
+ * At eol, before continuation.
28
+ *
29
+ * ```markdown
30
+ * > | * ```js
31
+ * ^
32
+ * | b
33
+ * ```
34
+ *
35
+ * @type {State}
36
+ */
37
+ function start(code) {
38
+ if (code === null) {
39
+ return nok(code);
40
+ }
41
+ effects.enter("lineEnding");
42
+ effects.consume(code);
43
+ effects.exit("lineEnding");
44
+ return after;
45
+ }
46
+
47
+ /**
48
+ * A continuation.
49
+ *
50
+ * ```markdown
51
+ * | * ```js
52
+ * > | b
53
+ * ^
54
+ * ```
55
+ *
56
+ * @type {State}
57
+ */
58
+ function after(code) {
59
+ return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
60
+ }
61
+ }