@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
@@ -33,20 +33,11 @@ export function preprocess() {
33
33
  /** @type {Preprocessor} */
34
34
  // eslint-disable-next-line complexity
35
35
  function preprocessor(value, encoding, end) {
36
+ value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));
37
+
36
38
  /** @type {Array<Chunk>} */
37
39
  const chunks = [];
38
- /** @type {RegExpMatchArray | null} */
39
- let match;
40
- /** @type {number} */
41
- let next;
42
- /** @type {number} */
43
- let startPosition;
44
- /** @type {number} */
45
- let endPosition;
46
- /** @type {Code} */
47
- let code;
48
- value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));
49
- startPosition = 0;
40
+ let startPosition = 0;
50
41
  buffer = '';
51
42
  if (start) {
52
43
  // To do: `markdown-rs` actually parses BOMs (byte order mark).
@@ -57,9 +48,9 @@ export function preprocess() {
57
48
  }
58
49
  while (startPosition < value.length) {
59
50
  search.lastIndex = startPosition;
60
- match = search.exec(value);
61
- endPosition = match && match.index !== undefined ? match.index : value.length;
62
- code = value.charCodeAt(endPosition);
51
+ const match = search.exec(value);
52
+ const endPosition = match && match.index !== undefined ? match.index : value.length;
53
+ const code = value.charCodeAt(endPosition);
63
54
  if (!match) {
64
55
  buffer = value.slice(startPosition);
65
56
  break;
@@ -85,9 +76,11 @@ export function preprocess() {
85
76
  }
86
77
  case 9:
87
78
  {
88
- next = Math.ceil(column / 4) * 4;
79
+ const next = Math.ceil(column / 4) * 4;
89
80
  chunks.push(-2);
90
- while (column++ < next) chunks.push(-1);
81
+ while (column++ < next) {
82
+ chunks.push(-1);
83
+ }
91
84
  break;
92
85
  }
93
86
  case 10:
@@ -106,8 +99,12 @@ export function preprocess() {
106
99
  startPosition = endPosition + 1;
107
100
  }
108
101
  if (end) {
109
- if (atCarriageReturn) chunks.push(-5);
110
- if (buffer) chunks.push(buffer);
102
+ if (atCarriageReturn) {
103
+ chunks.push(-5);
104
+ }
105
+ if (buffer) {
106
+ chunks.push(buffer);
107
+ }
111
108
  chunks.push(null);
112
109
  }
113
110
  return chunks;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micromark",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "small commonmark compliant markdown parser with positional info and concrete tokens",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -72,6 +72,7 @@
72
72
  "micromark-util-chunked": "^2.0.0",
73
73
  "micromark-util-combine-extensions": "^2.0.0",
74
74
  "micromark-util-decode-numeric-character-reference": "^2.0.0",
75
+ "micromark-util-edit-map": "^1.0.0",
75
76
  "micromark-util-encode": "^2.0.0",
76
77
  "micromark-util-normalize-identifier": "^2.0.0",
77
78
  "micromark-util-resolve-all": "^2.0.0",
@@ -82,19 +83,5 @@
82
83
  },
83
84
  "scripts": {
84
85
  "build": "micromark-build"
85
- },
86
- "xo": {
87
- "envs": [
88
- "shared-node-browser"
89
- ],
90
- "prettier": true,
91
- "rules": {
92
- "logical-assignment-operators": "off",
93
- "max-depth": "off",
94
- "unicorn/no-this-assignment": "off",
95
- "unicorn/prefer-at": "off",
96
- "unicorn/prefer-code-point": "off",
97
- "unicorn/prefer-event-target": "off"
98
- }
99
86
  }
100
87
  }
@@ -33,22 +33,8 @@ export const attention = {
33
33
  // eslint-disable-next-line complexity
34
34
  function resolveAllAttention(events, context) {
35
35
  let index = -1
36
- /** @type {number} */
37
- let open
38
- /** @type {Token} */
39
- let group
40
- /** @type {Token} */
41
- let text
42
- /** @type {Token} */
43
- let openingSequence
44
- /** @type {Token} */
45
- let closingSequence
46
- /** @type {number} */
47
- let use
48
36
  /** @type {Array<Event>} */
49
37
  let nextEvents
50
- /** @type {number} */
51
- let offset
52
38
 
53
39
  // Walk through all events.
54
40
  //
@@ -61,7 +47,7 @@ function resolveAllAttention(events, context) {
61
47
  events[index][1].type === 'attentionSequence' &&
62
48
  events[index][1]._close
63
49
  ) {
64
- open = index
50
+ let open = index
65
51
 
66
52
  // Now walk back to find an opener.
67
53
  while (open--) {
@@ -93,7 +79,7 @@ function resolveAllAttention(events, context) {
93
79
  }
94
80
 
95
81
  // Number of markers to use from the sequence.
96
- use =
82
+ const use =
97
83
  events[open][1].end.offset - events[open][1].start.offset > 1 &&
98
84
  events[index][1].end.offset - events[index][1].start.offset > 1
99
85
  ? 2
@@ -104,22 +90,22 @@ function resolveAllAttention(events, context) {
104
90
  movePoint(start, -use)
105
91
  movePoint(end, use)
106
92
 
107
- openingSequence = {
93
+ const openingSequence = {
108
94
  type: use > 1 ? types.strongSequence : types.emphasisSequence,
109
95
  start,
110
96
  end: {...events[open][1].end}
111
97
  }
112
- closingSequence = {
98
+ const closingSequence = {
113
99
  type: use > 1 ? types.strongSequence : types.emphasisSequence,
114
100
  start: {...events[index][1].start},
115
101
  end
116
102
  }
117
- text = {
103
+ const text = {
118
104
  type: use > 1 ? types.strongText : types.emphasisText,
119
105
  start: {...events[open][1].end},
120
106
  end: {...events[index][1].start}
121
107
  }
122
- group = {
108
+ const group = {
123
109
  type: use > 1 ? types.strong : types.emphasis,
124
110
  start: {...openingSequence.start},
125
111
  end: {...closingSequence.end}
@@ -170,6 +156,9 @@ function resolveAllAttention(events, context) {
170
156
  ['exit', group, context]
171
157
  ])
172
158
 
159
+ /** @type {number} */
160
+ let offset = 0
161
+
173
162
  // If there are more markers in the closing, add them after.
174
163
  if (events[index][1].end.offset - events[index][1].start.offset) {
175
164
  offset = 2
@@ -177,8 +166,6 @@ function resolveAllAttention(events, context) {
177
166
  ['enter', events[index][1], context],
178
167
  ['exit', events[index][1], context]
179
168
  ])
180
- } else {
181
- offset = 0
182
169
  }
183
170
 
184
171
  splice(events, open - 1, index - open + 3, nextEvents)
@@ -261,14 +248,21 @@ function tokenizeAttention(effects, ok) {
261
248
  // Always populated by defaults.
262
249
  assert(attentionMarkers, 'expected `attentionMarkers` to be populated')
263
250
 
251
+ // Note: `*` and `_` are in `attentionMarkers` through core.
252
+ // They are excluded here as the loosening is meant for markers registered
253
+ // by *other* constructs (such as GFM strikethrough’s `~`).
264
254
  const open =
265
255
  !after ||
266
256
  (after === constants.characterGroupPunctuation && before) ||
267
- attentionMarkers.includes(code)
257
+ (attentionMarkers.includes(code) &&
258
+ code !== codes.asterisk &&
259
+ code !== codes.underscore)
268
260
  const close =
269
261
  !before ||
270
262
  (before === constants.characterGroupPunctuation && after) ||
271
- attentionMarkers.includes(previous)
263
+ (attentionMarkers.includes(previous) &&
264
+ previous !== codes.asterisk &&
265
+ previous !== codes.underscore)
272
266
 
273
267
  token._open = Boolean(
274
268
  marker === codes.asterisk ? open : open && (before || !close)
@@ -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"}
@@ -12,12 +12,7 @@ import {ok as assert} from 'devlop'
12
12
  import {factorySpace} from 'micromark-factory-space'
13
13
  import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
14
14
  import {codes, constants, types} from 'micromark-util-symbol'
15
-
16
- /** @type {Construct} */
17
- const nonLazyContinuation = {
18
- partial: true,
19
- tokenize: tokenizeNonLazyContinuation
20
- }
15
+ import {nonLazyContinuation} from './partial-non-lazy-continuation.js'
21
16
 
22
17
  /** @type {Construct} */
23
18
  export const codeFenced = {
@@ -475,40 +470,3 @@ function tokenizeCodeFenced(effects, ok, nok) {
475
470
  }
476
471
  }
477
472
  }
478
-
479
- /**
480
- * @this {TokenizeContext}
481
- * Context.
482
- * @type {Tokenizer}
483
- */
484
- function tokenizeNonLazyContinuation(effects, ok, nok) {
485
- const self = this
486
-
487
- return start
488
-
489
- /**
490
- *
491
- *
492
- * @type {State}
493
- */
494
- function start(code) {
495
- if (code === codes.eof) {
496
- return nok(code)
497
- }
498
-
499
- assert(markdownLineEnding(code), 'expected eol')
500
- effects.enter(types.lineEnding)
501
- effects.consume(code)
502
- effects.exit(types.lineEnding)
503
- return lineStart
504
- }
505
-
506
- /**
507
- *
508
- *
509
- * @type {State}
510
- */
511
- function lineStart(code) {
512
- return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
513
- }
514
- }
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import {ok as assert} from 'devlop'
11
- import {factorySpace} from 'micromark-factory-space'
11
+ import {factorySpaceMinMax} from 'micromark-factory-space'
12
12
  import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
13
13
  import {codes, constants, types} from 'micromark-util-symbol'
14
14
 
@@ -27,7 +27,6 @@ const furtherStart = {partial: true, tokenize: tokenizeFurtherStart}
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,35 +47,16 @@ function tokenizeCodeIndented(effects, ok, nok) {
48
47
  // To do: manually check if interrupting like `markdown-rs`.
49
48
  assert(markdownSpace(code))
50
49
  effects.enter(types.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(
50
+ return factorySpaceMinMax(
54
51
  effects,
55
- afterPrefix,
52
+ atBreak,
53
+ nok,
56
54
  types.linePrefix,
57
- constants.tabSize + 1
55
+ constants.tabSize,
56
+ constants.tabSize
58
57
  )(code)
59
58
  }
60
59
 
61
- /**
62
- * At start, after 1 or 4 spaces.
63
- *
64
- * ```markdown
65
- * > | aaa
66
- * ^
67
- * ```
68
- *
69
- * @type {State}
70
- */
71
- function afterPrefix(code) {
72
- const tail = self.events[self.events.length - 1]
73
- return tail &&
74
- tail[1].type === types.linePrefix &&
75
- tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
76
- ? atBreak(code)
77
- : nok(code)
78
- }
79
-
80
60
  /**
81
61
  * At a break.
82
62
  *
@@ -168,35 +148,31 @@ function tokenizeFurtherStart(effects, ok, nok) {
168
148
  // To do: the code here in `micromark-js` is a bit different from
169
149
  // `markdown-rs` because there it can attempt spaces.
170
150
  // We can’t yet.
171
- //
172
- // To do: use an improved `space_or_tab` function like `markdown-rs`,
173
- // so that we can drop the next state.
174
- return factorySpace(
151
+ return factorySpaceMinMax(
175
152
  effects,
176
- afterPrefix,
153
+ ok,
154
+ onNotEnoughPrefix,
177
155
  types.linePrefix,
178
- constants.tabSize + 1
156
+ constants.tabSize,
157
+ constants.tabSize
179
158
  )(code)
180
159
  }
181
160
 
182
161
  /**
183
- * At start, after 1 or 4 spaces.
162
+ * After not enough of a prefix.
163
+ *
164
+ * A following line ending is another (potentially blank) line to try,
165
+ * anything else means this isn’t a continuation.
184
166
  *
185
167
  * ```markdown
186
168
  * > | aaa
187
- * ^
169
+ *
170
+ * | bbb
188
171
  * ```
189
172
  *
190
173
  * @type {State}
191
174
  */
192
- function afterPrefix(code) {
193
- const tail = self.events[self.events.length - 1]
194
- return tail &&
195
- tail[1].type === types.linePrefix &&
196
- tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
197
- ? ok(code)
198
- : markdownLineEnding(code)
199
- ? furtherStart(code)
200
- : nok(code)
175
+ function onNotEnoughPrefix(code) {
176
+ return markdownLineEnding(code) ? furtherStart(code) : nok(code)
201
177
  }
202
178
  }
@@ -30,10 +30,6 @@ export const headingAtx = {
30
30
  function resolveHeadingAtx(events, context) {
31
31
  let contentEnd = events.length - 2
32
32
  let contentStart = 3
33
- /** @type {Token} */
34
- let content
35
- /** @type {Token} */
36
- let text
37
33
 
38
34
  // Prefix whitespace, part of the opening.
39
35
  if (events[contentStart][1].type === types.whitespace) {
@@ -58,12 +54,12 @@ function resolveHeadingAtx(events, context) {
58
54
  }
59
55
 
60
56
  if (contentEnd > contentStart) {
61
- content = {
57
+ const content = {
62
58
  type: types.atxHeadingText,
63
59
  start: events[contentStart][1].start,
64
60
  end: events[contentEnd][1].end
65
61
  }
66
- text = {
62
+ const text = {
67
63
  type: types.chunkText,
68
64
  start: events[contentStart][1].start,
69
65
  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"}
@@ -20,6 +20,7 @@ import {
20
20
  import {htmlBlockNames, htmlRawNames} from 'micromark-util-html-tag-name'
21
21
  import {codes, constants, types} from 'micromark-util-symbol'
22
22
  import {blankLine} from './blank-line.js'
23
+ import {nonLazyContinuation} from './partial-non-lazy-continuation.js'
23
24
 
24
25
  /** @type {Construct} */
25
26
  export const htmlFlow = {
@@ -31,10 +32,6 @@ export const htmlFlow = {
31
32
 
32
33
  /** @type {Construct} */
33
34
  const blankLineBefore = {partial: true, tokenize: tokenizeBlankLineBefore}
34
- const nonLazyContinuationStart = {
35
- partial: true,
36
- tokenize: tokenizeNonLazyContinuationStart
37
- }
38
35
 
39
36
  /** @type {Resolver} */
40
37
  function resolveToHtmlFlow(events) {
@@ -704,7 +701,7 @@ function tokenizeHtmlFlow(effects, ok, nok) {
704
701
  */
705
702
  function continuationStart(code) {
706
703
  return effects.check(
707
- nonLazyContinuationStart,
704
+ nonLazyContinuation,
708
705
  continuationStartNonLazy,
709
706
  continuationAfter
710
707
  )(code)
@@ -912,54 +909,6 @@ function tokenizeHtmlFlow(effects, ok, nok) {
912
909
  }
913
910
  }
914
911
 
915
- /**
916
- * @this {TokenizeContext}
917
- * Context.
918
- * @type {Tokenizer}
919
- */
920
- function tokenizeNonLazyContinuationStart(effects, ok, nok) {
921
- const self = this
922
-
923
- return start
924
-
925
- /**
926
- * At eol, before continuation.
927
- *
928
- * ```markdown
929
- * > | * ```js
930
- * ^
931
- * | b
932
- * ```
933
- *
934
- * @type {State}
935
- */
936
- function start(code) {
937
- if (markdownLineEnding(code)) {
938
- effects.enter(types.lineEnding)
939
- effects.consume(code)
940
- effects.exit(types.lineEnding)
941
- return after
942
- }
943
-
944
- return nok(code)
945
- }
946
-
947
- /**
948
- * A continuation.
949
- *
950
- * ```markdown
951
- * | * ```js
952
- * > | b
953
- * ^
954
- * ```
955
- *
956
- * @type {State}
957
- */
958
- function after(code) {
959
- return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
960
- }
961
- }
962
-
963
912
  /**
964
913
  * @this {TokenizeContext}
965
914
  * Context.
@@ -69,8 +69,6 @@ function resolveAllLabelEnd(events) {
69
69
  function resolveToLabelEnd(events, context) {
70
70
  let index = events.length
71
71
  let offset = 0
72
- /** @type {Token} */
73
- let token
74
72
  /** @type {number | undefined} */
75
73
  let open
76
74
  /** @type {number | undefined} */
@@ -80,7 +78,7 @@ function resolveToLabelEnd(events, context) {
80
78
 
81
79
  // Find an opening.
82
80
  while (index--) {
83
- token = events[index][1]
81
+ const token = events[index][1]
84
82
 
85
83
  if (open) {
86
84
  // If we see another link, or inactive link label, we’ve been here before.
@@ -187,22 +185,23 @@ function resolveToLabelEnd(events, context) {
187
185
  */
188
186
  function tokenizeLabelEnd(effects, ok, nok) {
189
187
  const self = this
190
- let index = self.events.length
188
+ const labelStarts = self._labelStarts
191
189
  /** @type {Token} */
192
190
  let labelStart
193
191
  /** @type {boolean} */
194
192
  let defined
195
193
 
196
- // Find an opening.
197
- while (index--) {
198
- if (
199
- (self.events[index][1].type === types.labelImage ||
200
- self.events[index][1].type === types.labelLink) &&
201
- !self.events[index][1]._balanced
194
+ if (labelStarts) {
195
+ // Discard ones that failed to close,
196
+ // they’re not needed anymore.
197
+ while (
198
+ labelStarts.length > 0 &&
199
+ labelStarts[labelStarts.length - 1]._balanced
202
200
  ) {
203
- labelStart = self.events[index][1]
204
- break
201
+ labelStarts.pop()
205
202
  }
203
+
204
+ labelStart = labelStarts[labelStarts.length - 1]
206
205
  }
207
206
 
208
207
  return start
@@ -338,6 +337,9 @@ function tokenizeLabelEnd(effects, ok, nok) {
338
337
  */
339
338
  function labelEndOk(code) {
340
339
  // Note: `markdown-rs` does a bunch of stuff here.
340
+ // This label start is now used up: discard it so it’s never found again.
341
+ assert(labelStarts, 'expected `labelStarts` to be populated')
342
+ labelStarts.pop()
341
343
  return ok(code)
342
344
  }
343
345
 
@@ -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'
@@ -25,6 +26,8 @@ export const labelStartImage = {
25
26
  */
26
27
  function tokenizeLabelStartImage(effects, ok, nok) {
27
28
  const self = this
29
+ /** @type {Token} */
30
+ let labelImage
28
31
 
29
32
  return start
30
33
 
@@ -62,7 +65,7 @@ function tokenizeLabelStartImage(effects, ok, nok) {
62
65
  effects.enter(types.labelMarker)
63
66
  effects.consume(code)
64
67
  effects.exit(types.labelMarker)
65
- effects.exit(types.labelImage)
68
+ labelImage = effects.exit(types.labelImage)
66
69
  return after
67
70
  }
68
71
 
@@ -101,10 +104,16 @@ function tokenizeLabelStartImage(effects, ok, nok) {
101
104
  // `micromark-extension-gfm-footnote`, but the `label-start-link`
102
105
  // behavior isn’t.
103
106
  // Hidden footnotes hook.
104
- /* c8 ignore next 3 */
105
- return code === codes.caret &&
107
+ /* c8 ignore next 6 */
108
+ if (
109
+ code === codes.caret &&
106
110
  '_hiddenFootnoteSupport' in self.parser.constructs
107
- ? nok(code)
108
- : ok(code)
111
+ ) {
112
+ return nok(code)
113
+ }
114
+
115
+ self._labelStarts = self._labelStarts || []
116
+ self._labelStarts.push(labelImage)
117
+ return ok(code)
109
118
  }
110
119
  }
@@ -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'
@@ -25,6 +26,8 @@ export const labelStartLink = {
25
26
  */
26
27
  function tokenizeLabelStartLink(effects, ok, nok) {
27
28
  const self = this
29
+ /** @type {Token} */
30
+ let labelLink
28
31
 
29
32
  return start
30
33
 
@@ -44,7 +47,7 @@ function tokenizeLabelStartLink(effects, ok, nok) {
44
47
  effects.enter(types.labelMarker)
45
48
  effects.consume(code)
46
49
  effects.exit(types.labelMarker)
47
- effects.exit(types.labelLink)
50
+ labelLink = effects.exit(types.labelLink)
48
51
  return after
49
52
  }
50
53
 
@@ -53,10 +56,16 @@ function tokenizeLabelStartLink(effects, ok, nok) {
53
56
  // To do: this isn’t needed in `micromark-extension-gfm-footnote`,
54
57
  // remove.
55
58
  // Hidden footnotes hook.
56
- /* c8 ignore next 3 */
57
- return code === codes.caret &&
59
+ /* c8 ignore next 6 */
60
+ if (
61
+ code === codes.caret &&
58
62
  '_hiddenFootnoteSupport' in self.parser.constructs
59
- ? nok(code)
60
- : ok(code)
63
+ ) {
64
+ return nok(code)
65
+ }
66
+
67
+ self._labelStarts = self._labelStarts || []
68
+ self._labelStarts.push(labelLink)
69
+ return ok(code)
61
70
  }
62
71
  }
@@ -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"}