securemark 0.295.0 → 0.295.2

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 (169) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/design.md +4 -3
  3. package/dist/index.js +529 -484
  4. package/markdown.d.ts +13 -28
  5. package/package.json +1 -1
  6. package/src/combinator/control/constraint/block.test.ts +6 -8
  7. package/src/combinator/control/constraint/contract.ts +7 -7
  8. package/src/combinator/control/constraint/line.test.ts +7 -9
  9. package/src/combinator/control/constraint/line.ts +0 -1
  10. package/src/combinator/control/manipulation/clear.ts +2 -2
  11. package/src/combinator/control/manipulation/convert.ts +3 -3
  12. package/src/combinator/control/manipulation/duplicate.ts +4 -4
  13. package/src/combinator/control/manipulation/fallback.ts +2 -2
  14. package/src/combinator/control/manipulation/fence.ts +3 -3
  15. package/src/combinator/control/manipulation/indent.test.ts +20 -22
  16. package/src/combinator/control/manipulation/indent.ts +2 -2
  17. package/src/combinator/control/manipulation/recovery.ts +3 -3
  18. package/src/combinator/control/manipulation/reverse.ts +2 -2
  19. package/src/combinator/control/manipulation/scope.ts +2 -4
  20. package/src/combinator/control/manipulation/surround.ts +66 -66
  21. package/src/combinator/control/monad/bind.ts +6 -6
  22. package/src/combinator/control/monad/fmap.ts +6 -6
  23. package/src/combinator/data/data.ts +2 -2
  24. package/src/combinator/data/{parser/context/delimiter.ts → delimiter.ts} +4 -4
  25. package/src/combinator/data/parser/context.test.ts +12 -11
  26. package/src/combinator/data/parser/context.ts +13 -14
  27. package/src/combinator/data/parser/inits.ts +5 -5
  28. package/src/combinator/data/parser/sequence.test.ts +12 -13
  29. package/src/combinator/data/parser/sequence.ts +5 -5
  30. package/src/combinator/data/parser/some.test.ts +15 -16
  31. package/src/combinator/data/parser/some.ts +5 -6
  32. package/src/combinator/data/parser/subsequence.test.ts +16 -17
  33. package/src/combinator/data/parser/subsequence.ts +3 -3
  34. package/src/combinator/data/parser/tails.ts +3 -3
  35. package/src/combinator/data/parser/union.test.ts +12 -13
  36. package/src/combinator/data/parser/union.ts +3 -3
  37. package/src/combinator/data/parser.ts +55 -32
  38. package/src/debug.test.ts +5 -3
  39. package/src/parser/api/bind.ts +8 -6
  40. package/src/parser/api/header.ts +4 -4
  41. package/src/parser/api/normalize.ts +2 -1
  42. package/src/parser/api/parse.test.ts +7 -6
  43. package/src/parser/api/parse.ts +9 -8
  44. package/src/parser/autolink.test.ts +18 -18
  45. package/src/parser/block/blockquote.test.ts +79 -79
  46. package/src/parser/block/blockquote.ts +5 -5
  47. package/src/parser/block/codeblock.test.ts +57 -57
  48. package/src/parser/block/codeblock.ts +3 -3
  49. package/src/parser/block/dlist.test.ts +57 -57
  50. package/src/parser/block/dlist.ts +6 -6
  51. package/src/parser/block/extension/aside.test.ts +9 -9
  52. package/src/parser/block/extension/aside.ts +5 -5
  53. package/src/parser/block/extension/example.test.ts +19 -19
  54. package/src/parser/block/extension/example.ts +6 -6
  55. package/src/parser/block/extension/fig.test.ts +36 -36
  56. package/src/parser/block/extension/figbase.test.ts +16 -16
  57. package/src/parser/block/extension/figbase.ts +2 -2
  58. package/src/parser/block/extension/figure.test.ts +63 -63
  59. package/src/parser/block/extension/figure.ts +3 -3
  60. package/src/parser/block/extension/message.test.ts +14 -14
  61. package/src/parser/block/extension/message.ts +5 -5
  62. package/src/parser/block/extension/placeholder.test.ts +13 -13
  63. package/src/parser/block/extension/placeholder.ts +2 -2
  64. package/src/parser/block/extension/table.test.ts +76 -76
  65. package/src/parser/block/extension/table.ts +14 -14
  66. package/src/parser/block/extension.test.ts +24 -24
  67. package/src/parser/block/heading.test.ts +59 -59
  68. package/src/parser/block/heading.ts +7 -7
  69. package/src/parser/block/ilist.test.ts +8 -12
  70. package/src/parser/block/ilist.ts +6 -6
  71. package/src/parser/block/mathblock.test.ts +32 -32
  72. package/src/parser/block/mathblock.ts +3 -3
  73. package/src/parser/block/mediablock.ts +3 -3
  74. package/src/parser/block/olist.test.ts +103 -103
  75. package/src/parser/block/olist.ts +5 -5
  76. package/src/parser/block/pagebreak.test.ts +16 -16
  77. package/src/parser/block/pagebreak.ts +2 -2
  78. package/src/parser/block/paragraph.test.ts +58 -58
  79. package/src/parser/block/paragraph.ts +2 -2
  80. package/src/parser/block/reply/cite.test.ts +40 -40
  81. package/src/parser/block/reply/cite.ts +6 -6
  82. package/src/parser/block/reply/quote.test.ts +51 -51
  83. package/src/parser/block/reply/quote.ts +3 -3
  84. package/src/parser/block/reply.test.ts +20 -20
  85. package/src/parser/block/reply.ts +3 -3
  86. package/src/parser/block/sidefence.test.ts +48 -48
  87. package/src/parser/block/sidefence.ts +4 -4
  88. package/src/parser/block/table.test.ts +50 -50
  89. package/src/parser/block/table.ts +12 -12
  90. package/src/parser/block/ulist.test.ts +53 -53
  91. package/src/parser/block/ulist.ts +6 -6
  92. package/src/parser/block.ts +6 -4
  93. package/src/parser/context.ts +39 -0
  94. package/src/parser/header.test.ts +23 -23
  95. package/src/parser/header.ts +5 -5
  96. package/src/parser/inline/annotation.test.ts +43 -43
  97. package/src/parser/inline/annotation.ts +15 -5
  98. package/src/parser/inline/autolink/account.test.ts +33 -33
  99. package/src/parser/inline/autolink/account.ts +9 -9
  100. package/src/parser/inline/autolink/anchor.test.ts +22 -22
  101. package/src/parser/inline/autolink/anchor.ts +4 -4
  102. package/src/parser/inline/autolink/channel.test.ts +15 -15
  103. package/src/parser/inline/autolink/email.test.ts +37 -37
  104. package/src/parser/inline/autolink/email.ts +2 -2
  105. package/src/parser/inline/autolink/hashnum.test.ts +33 -33
  106. package/src/parser/inline/autolink/hashnum.ts +6 -5
  107. package/src/parser/inline/autolink/hashtag.test.ts +60 -60
  108. package/src/parser/inline/autolink/hashtag.ts +4 -4
  109. package/src/parser/inline/autolink/url.test.ts +75 -75
  110. package/src/parser/inline/autolink/url.ts +4 -4
  111. package/src/parser/inline/bracket.test.ts +70 -70
  112. package/src/parser/inline/bracket.ts +35 -32
  113. package/src/parser/inline/code.test.ts +31 -31
  114. package/src/parser/inline/code.ts +4 -4
  115. package/src/parser/inline/deletion.test.ts +28 -28
  116. package/src/parser/inline/deletion.ts +4 -4
  117. package/src/parser/inline/emphasis.test.ts +40 -40
  118. package/src/parser/inline/emphasis.ts +3 -3
  119. package/src/parser/inline/emstrong.test.ts +101 -101
  120. package/src/parser/inline/emstrong.ts +23 -23
  121. package/src/parser/inline/extension/index.test.ts +92 -92
  122. package/src/parser/inline/extension/index.ts +5 -5
  123. package/src/parser/inline/extension/indexee.ts +5 -5
  124. package/src/parser/inline/extension/indexer.test.ts +24 -24
  125. package/src/parser/inline/extension/indexer.ts +2 -2
  126. package/src/parser/inline/extension/label.test.ts +33 -33
  127. package/src/parser/inline/extension/label.ts +2 -2
  128. package/src/parser/inline/extension/placeholder.test.ts +43 -43
  129. package/src/parser/inline/extension/placeholder.ts +4 -4
  130. package/src/parser/inline/html.test.ts +108 -108
  131. package/src/parser/inline/html.ts +10 -10
  132. package/src/parser/inline/htmlentity.test.ts +38 -38
  133. package/src/parser/inline/htmlentity.ts +5 -5
  134. package/src/parser/inline/insertion.test.ts +28 -28
  135. package/src/parser/inline/insertion.ts +4 -4
  136. package/src/parser/inline/italic.test.ts +55 -55
  137. package/src/parser/inline/italic.ts +4 -4
  138. package/src/parser/inline/link.test.ts +186 -187
  139. package/src/parser/inline/link.ts +16 -17
  140. package/src/parser/inline/mark.test.ts +31 -31
  141. package/src/parser/inline/mark.ts +5 -5
  142. package/src/parser/inline/math.test.ts +132 -132
  143. package/src/parser/inline/math.ts +2 -2
  144. package/src/parser/inline/media.test.ts +91 -91
  145. package/src/parser/inline/media.ts +15 -15
  146. package/src/parser/inline/reference.test.ts +109 -109
  147. package/src/parser/inline/reference.ts +16 -55
  148. package/src/parser/inline/remark.test.ts +50 -50
  149. package/src/parser/inline/remark.ts +5 -5
  150. package/src/parser/inline/ruby.test.ts +45 -45
  151. package/src/parser/inline/ruby.ts +17 -17
  152. package/src/parser/inline/shortmedia.test.ts +10 -10
  153. package/src/parser/inline/strong.test.ts +37 -37
  154. package/src/parser/inline/strong.ts +3 -3
  155. package/src/parser/inline/template.test.ts +23 -23
  156. package/src/parser/inline/template.ts +5 -5
  157. package/src/parser/inline.test.ts +224 -223
  158. package/src/parser/segment.ts +2 -2
  159. package/src/parser/source/escapable.test.ts +24 -24
  160. package/src/parser/source/escapable.ts +8 -8
  161. package/src/parser/source/line.test.ts +18 -18
  162. package/src/parser/source/str.ts +2 -2
  163. package/src/parser/source/text.test.ts +85 -85
  164. package/src/parser/source/text.ts +5 -5
  165. package/src/parser/source/unescapable.test.ts +24 -24
  166. package/src/parser/source/unescapable.ts +5 -5
  167. package/src/parser/util.ts +10 -11
  168. package/src/parser/visibility.ts +8 -9
  169. package/src/util/quote.ts +2 -1
@@ -1,40 +1,40 @@
1
1
  import { table } from './table';
2
2
  import { some } from '../../../combinator';
3
3
  import { input } from '../../../combinator/data/parser';
4
+ import { Context } from '../../context';
4
5
  import { inspect } from '../../../debug.test';
5
6
  import { html } from 'typed-dom/dom';
6
7
 
7
8
  describe('Unit: parser/block/extension/table', () => {
8
9
  describe('table', () => {
9
- const parser = (source: string) => some(table)(input(source, ctx));
10
- const { context: ctx } = input('', {});
10
+ const parser = some(table);
11
11
 
12
12
  it('invalid', () => {
13
- assert.deepStrictEqual(inspect(parser('~~~table a\n-\n~~~'), ctx), [['<pre class="invalid" translate="no">~~~table a\n-\n~~~</pre>'], '']);
14
- assert.deepStrictEqual(inspect(parser(`~~~table\n0${'\n'.repeat(10001)}~~~`), ctx, '>'), [['<pre class="invalid" translate="no">'], '']);
13
+ assert.deepStrictEqual(inspect(parser, input('~~~table a\n-\n~~~', new Context())), [['<pre class="invalid" translate="no">~~~table a\n-\n~~~</pre>'], '']);
14
+ assert.deepStrictEqual(inspect(parser, input(`~~~table\n0${'\n'.repeat(10001)}~~~`, new Context()), '>'), [['<pre class="invalid" translate="no">'], '']);
15
15
  });
16
16
 
17
17
  it('data', () => {
18
18
  assert.deepStrictEqual(
19
- inspect(parser('~~~table\n~~~'), ctx),
19
+ inspect(parser, input('~~~table\n~~~', new Context())),
20
20
  [[html('table').outerHTML], '']);
21
21
  assert.deepStrictEqual(
22
- inspect(parser('~~~table\n\n~~~\n'), ctx),
22
+ inspect(parser, input('~~~table\n\n~~~\n', new Context())),
23
23
  [[html('table', [html('thead', [html('tr')]), html('tbody'), html('tfoot')]).outerHTML], '']);
24
24
  assert.deepStrictEqual(
25
- inspect(parser('~~~table\n-\n~~~'), ctx),
25
+ inspect(parser, input('~~~table\n-\n~~~', new Context())),
26
26
  [[html('table', [html('thead', [html('tr')]), html('tbody'), html('tfoot')]).outerHTML], '']);
27
27
  assert.deepStrictEqual(
28
- inspect(parser('~~~table\n-\n\n~~~'), ctx),
28
+ inspect(parser, input('~~~table\n-\n\n~~~', new Context())),
29
29
  [[html('table', [html('thead', [html('tr')]), html('tbody'), html('tfoot')]).outerHTML], '']);
30
30
  assert.deepStrictEqual(
31
- inspect(parser('~~~table\n0\n\n~~~'), ctx),
31
+ inspect(parser, input('~~~table\n0\n\n~~~', new Context())),
32
32
  [[html('table', [html('thead'), html('tbody', [html('tr', [html('td', '0')])]), html('tfoot')]).outerHTML], '']);
33
33
  assert.deepStrictEqual(
34
- inspect(parser('~~~table\n:\n~~~'), ctx),
34
+ inspect(parser, input('~~~table\n:\n~~~', new Context())),
35
35
  [[html('table', [html('thead'), html('tbody', [html('tr', [html('td')])]), html('tfoot'),]).outerHTML], '']);
36
36
  assert.deepStrictEqual(
37
- inspect(parser('~~~table\n1.1\n~~~'), ctx),
37
+ inspect(parser, input('~~~table\n1.1\n~~~', new Context())),
38
38
  [[html('table', [
39
39
  html('thead'),
40
40
  html('tbody', [
@@ -43,7 +43,7 @@ describe('Unit: parser/block/extension/table', () => {
43
43
  html('tfoot'),
44
44
  ]).outerHTML], '']);
45
45
  assert.deepStrictEqual(
46
- inspect(parser('~~~table\n1.1\n1.2\n\n1.3\n~~~'), ctx),
46
+ inspect(parser, input('~~~table\n1.1\n1.2\n\n1.3\n~~~', new Context())),
47
47
  [[html('table', [
48
48
  html('thead'),
49
49
  html('tbody', [
@@ -52,7 +52,7 @@ describe('Unit: parser/block/extension/table', () => {
52
52
  html('tfoot'),
53
53
  ]).outerHTML], '']);
54
54
  assert.deepStrictEqual(
55
- inspect(parser('~~~table\n1.1\n-\n2.1\n~~~'), ctx),
55
+ inspect(parser, input('~~~table\n1.1\n-\n2.1\n~~~', new Context())),
56
56
  [[html('table', [
57
57
  html('thead'),
58
58
  html('tbody', [
@@ -62,7 +62,7 @@ describe('Unit: parser/block/extension/table', () => {
62
62
  html('tfoot'),
63
63
  ]).outerHTML], '']);
64
64
  assert.deepStrictEqual(
65
- inspect(parser('~~~table\n: 1.1\n0\n~~~'), ctx),
65
+ inspect(parser, input('~~~table\n: 1.1\n0\n~~~', new Context())),
66
66
  [[html('table', [
67
67
  html('thead'),
68
68
  html('tbody', [
@@ -71,7 +71,7 @@ describe('Unit: parser/block/extension/table', () => {
71
71
  html('tfoot'),
72
72
  ]).outerHTML], '']);
73
73
  assert.deepStrictEqual(
74
- inspect(parser('~~~table\n: 1.1\n: 1.2\n~~~'), ctx),
74
+ inspect(parser, input('~~~table\n: 1.1\n: 1.2\n~~~', new Context())),
75
75
  [[html('table', [
76
76
  html('thead'),
77
77
  html('tbody', [
@@ -80,7 +80,7 @@ describe('Unit: parser/block/extension/table', () => {
80
80
  html('tfoot'),
81
81
  ]).outerHTML], '']);
82
82
  assert.deepStrictEqual(
83
- inspect(parser('~~~table\n: 1.1\n\n1.2\n~~~'), ctx),
83
+ inspect(parser, input('~~~table\n: 1.1\n\n1.2\n~~~', new Context())),
84
84
  [[html('table', [
85
85
  html('thead'),
86
86
  html('tbody', [
@@ -89,7 +89,7 @@ describe('Unit: parser/block/extension/table', () => {
89
89
  html('tfoot'),
90
90
  ]).outerHTML], '']);
91
91
  assert.deepStrictEqual(
92
- inspect(parser('~~~table\n1.1\n: 1.2\n:1:1 1.3\n\n: 1.4\n~~~'), ctx),
92
+ inspect(parser, input('~~~table\n1.1\n: 1.2\n:1:1 1.3\n\n: 1.4\n~~~', new Context())),
93
93
  [[html('table', [
94
94
  html('thead'),
95
95
  html('tbody', [
@@ -98,7 +98,7 @@ describe('Unit: parser/block/extension/table', () => {
98
98
  html('tfoot'),
99
99
  ]).outerHTML], '']);
100
100
  assert.deepStrictEqual(
101
- inspect(parser('~~~table\n:\n1\n~~~'), ctx),
101
+ inspect(parser, input('~~~table\n:\n1\n~~~', new Context())),
102
102
  [[html('table', [
103
103
  html('thead'),
104
104
  html('tbody', [
@@ -107,7 +107,7 @@ describe('Unit: parser/block/extension/table', () => {
107
107
  html('tfoot'),
108
108
  ]).outerHTML], '']);
109
109
  assert.deepStrictEqual(
110
- inspect(parser('~~~table\n: \n1\n~~~'), ctx),
110
+ inspect(parser, input('~~~table\n: \n1\n~~~', new Context())),
111
111
  [[html('table', [
112
112
  html('thead'),
113
113
  html('tbody', [
@@ -116,7 +116,7 @@ describe('Unit: parser/block/extension/table', () => {
116
116
  html('tfoot'),
117
117
  ]).outerHTML], '']);
118
118
  assert.deepStrictEqual(
119
- inspect(parser('~~~table\n: \n 1\n~~~'), ctx),
119
+ inspect(parser, input('~~~table\n: \n 1\n~~~', new Context())),
120
120
  [[html('table', [
121
121
  html('thead'),
122
122
  html('tbody', [
@@ -125,7 +125,7 @@ describe('Unit: parser/block/extension/table', () => {
125
125
  html('tfoot'),
126
126
  ]).outerHTML], '']);
127
127
  assert.deepStrictEqual(
128
- inspect(parser('~~~table\n: \n\n1\n~~~'), ctx),
128
+ inspect(parser, input('~~~table\n: \n\n1\n~~~', new Context())),
129
129
  [[html('table', [
130
130
  html('thead'),
131
131
  html('tbody', [
@@ -134,7 +134,7 @@ describe('Unit: parser/block/extension/table', () => {
134
134
  html('tfoot'),
135
135
  ]).outerHTML], '']);
136
136
  assert.deepStrictEqual(
137
- inspect(parser('~~~table\n\\ \n\\ \n~~~'), ctx),
137
+ inspect(parser, input('~~~table\n\\ \n\\ \n~~~', new Context())),
138
138
  [[html('table', [
139
139
  html('thead'),
140
140
  html('tbody', [
@@ -143,7 +143,7 @@ describe('Unit: parser/block/extension/table', () => {
143
143
  html('tfoot'),
144
144
  ]).outerHTML], '']);
145
145
  assert.deepStrictEqual(
146
- inspect(parser('~~~table\n: \\ \n\\ \n0\n~~~'), ctx),
146
+ inspect(parser, input('~~~table\n: \\ \n\\ \n0\n~~~', new Context())),
147
147
  [[html('table', [
148
148
  html('thead'),
149
149
  html('tbody', [
@@ -155,16 +155,16 @@ describe('Unit: parser/block/extension/table', () => {
155
155
 
156
156
  it('align', () => {
157
157
  assert.deepStrictEqual(
158
- inspect(parser('~~~table\n-=<>\n~~~'), ctx),
158
+ inspect(parser, input('~~~table\n-=<>\n~~~', new Context())),
159
159
  [[html('table', [html('thead', [html('tr')]), html('tbody'), html('tfoot')]).outerHTML], '']);
160
160
  assert.deepStrictEqual(
161
- inspect(parser('~~~table\n-=<>/-=^v\n~~~'), ctx),
161
+ inspect(parser, input('~~~table\n-=<>/-=^v\n~~~', new Context())),
162
162
  [[html('table', [html('thead', [html('tr')]), html('tbody'), html('tfoot')]).outerHTML], '']);
163
163
  assert.deepStrictEqual(
164
- inspect(parser('~~~table\n-/-=^v\n~~~'), ctx),
164
+ inspect(parser, input('~~~table\n-/-=^v\n~~~', new Context())),
165
165
  [[html('table', [html('thead', [html('tr')]), html('tbody'), html('tfoot')]).outerHTML], '']);
166
166
  assert.deepStrictEqual(
167
- inspect(parser('~~~table\n-=^v\n~~~'), ctx),
167
+ inspect(parser, input('~~~table\n-=^v\n~~~', new Context())),
168
168
  [[html('table', [
169
169
  html('thead'),
170
170
  html('tbody', [
@@ -172,7 +172,7 @@ describe('Unit: parser/block/extension/table', () => {
172
172
  ]),
173
173
  html('tfoot')]).outerHTML], '']);
174
174
  assert.deepStrictEqual(
175
- inspect(parser('~~~table\n=-<>\n1.1\n1.2\n1.3\n1.4\n1.5\n1.6\n~~~'), ctx),
175
+ inspect(parser, input('~~~table\n=-<>\n1.1\n1.2\n1.3\n1.4\n1.5\n1.6\n~~~', new Context())),
176
176
  [[html('table', [
177
177
  html('thead'),
178
178
  html('tbody', [
@@ -188,7 +188,7 @@ describe('Unit: parser/block/extension/table', () => {
188
188
  html('tfoot'),
189
189
  ]).outerHTML], '']);
190
190
  assert.deepStrictEqual(
191
- inspect(parser('~~~table\n=<\n-\n2.1\n2.2\n2.3\n~~~'), ctx),
191
+ inspect(parser, input('~~~table\n=<\n-\n2.1\n2.2\n2.3\n~~~', new Context())),
192
192
  [[html('table', [
193
193
  html('thead', [html('tr')]),
194
194
  html('tbody', [
@@ -201,7 +201,7 @@ describe('Unit: parser/block/extension/table', () => {
201
201
  html('tfoot'),
202
202
  ]).outerHTML], '']);
203
203
  assert.deepStrictEqual(
204
- inspect(parser('~~~table\n=<\n=\n2.1\n2.2\n2.3\n~~~'), ctx),
204
+ inspect(parser, input('~~~table\n=<\n=\n2.1\n2.2\n2.3\n~~~', new Context())),
205
205
  [[html('table', [
206
206
  html('thead', [html('tr')]),
207
207
  html('tbody', [
@@ -214,7 +214,7 @@ describe('Unit: parser/block/extension/table', () => {
214
214
  html('tfoot'),
215
215
  ]).outerHTML], '']);
216
216
  assert.deepStrictEqual(
217
- inspect(parser('~~~table\n=<\n=-\n2.1\n2.2\n2.3\n~~~'), ctx),
217
+ inspect(parser, input('~~~table\n=<\n=-\n2.1\n2.2\n2.3\n~~~', new Context())),
218
218
  [[html('table', [
219
219
  html('thead', [html('tr')]),
220
220
  html('tbody', [
@@ -227,7 +227,7 @@ describe('Unit: parser/block/extension/table', () => {
227
227
  html('tfoot'),
228
228
  ]).outerHTML], '']);
229
229
  assert.deepStrictEqual(
230
- inspect(parser('~~~table\n-/=-^v\n1.1\n1.2\n1.3\n1.4\n1.5\n1.6\n~~~'), ctx),
230
+ inspect(parser, input('~~~table\n-/=-^v\n1.1\n1.2\n1.3\n1.4\n1.5\n1.6\n~~~', new Context())),
231
231
  [[html('table', [
232
232
  html('thead'),
233
233
  html('tbody', [
@@ -243,7 +243,7 @@ describe('Unit: parser/block/extension/table', () => {
243
243
  html('tfoot'),
244
244
  ]).outerHTML], '']);
245
245
  assert.deepStrictEqual(
246
- inspect(parser('~~~table\n-/=^\n-/-\n2.1\n2.2\n2.3\n~~~'), ctx),
246
+ inspect(parser, input('~~~table\n-/=^\n-/-\n2.1\n2.2\n2.3\n~~~', new Context())),
247
247
  [[html('table', [
248
248
  html('thead', [html('tr')]),
249
249
  html('tbody', [
@@ -259,10 +259,10 @@ describe('Unit: parser/block/extension/table', () => {
259
259
 
260
260
  it('head', () => {
261
261
  assert.deepStrictEqual(
262
- inspect(parser('~~~table\n#\n~~~'), ctx),
262
+ inspect(parser, input('~~~table\n#\n~~~', new Context())),
263
263
  [[html('table', [html('thead', [html('tr', [html('th')])]), html('tbody'), html('tfoot'),]).outerHTML], '']);
264
264
  assert.deepStrictEqual(
265
- inspect(parser('~~~table\n-\n# 1.1\n~~~'), ctx),
265
+ inspect(parser, input('~~~table\n-\n# 1.1\n~~~', new Context())),
266
266
  [[html('table', [
267
267
  html('thead', [
268
268
  html('tr', [html('th', '1.1')]),
@@ -270,7 +270,7 @@ describe('Unit: parser/block/extension/table', () => {
270
270
  html('tbody'),
271
271
  html('tfoot')]).outerHTML], '']);
272
272
  assert.deepStrictEqual(
273
- inspect(parser('~~~table\n-/-\n# 1.1\n~~~'), ctx),
273
+ inspect(parser, input('~~~table\n-/-\n# 1.1\n~~~', new Context())),
274
274
  [[html('table', [
275
275
  html('thead', [
276
276
  html('tr', [html('th', '1.1')]),
@@ -278,7 +278,7 @@ describe('Unit: parser/block/extension/table', () => {
278
278
  html('tbody'),
279
279
  html('tfoot')]).outerHTML], '']);
280
280
  assert.deepStrictEqual(
281
- inspect(parser('~~~table\n# 1.1\n~~~'), ctx),
281
+ inspect(parser, input('~~~table\n# 1.1\n~~~', new Context())),
282
282
  [[html('table', [
283
283
  html('thead', [
284
284
  html('tr', [html('th', '1.1')]),
@@ -286,7 +286,7 @@ describe('Unit: parser/block/extension/table', () => {
286
286
  html('tbody'),
287
287
  html('tfoot')]).outerHTML], '']);
288
288
  assert.deepStrictEqual(
289
- inspect(parser('~~~table\n# 1.1\n: 1.2\n~~~'), ctx),
289
+ inspect(parser, input('~~~table\n# 1.1\n: 1.2\n~~~', new Context())),
290
290
  [[html('table', [
291
291
  html('thead'),
292
292
  html('tbody', [
@@ -297,7 +297,7 @@ describe('Unit: parser/block/extension/table', () => {
297
297
 
298
298
  it('foot', () => {
299
299
  assert.deepStrictEqual(
300
- inspect(parser('~~~table\n1.1\n-\n# 2.1\n~~~'), ctx),
300
+ inspect(parser, input('~~~table\n1.1\n-\n# 2.1\n~~~', new Context())),
301
301
  [[html('table', [
302
302
  html('thead'),
303
303
  html('tbody', [
@@ -310,7 +310,7 @@ describe('Unit: parser/block/extension/table', () => {
310
310
 
311
311
  it('highlight', () => {
312
312
  assert.deepStrictEqual(
313
- inspect(parser('~~~table\n#! 1.1\n~~~'), ctx),
313
+ inspect(parser, input('~~~table\n#! 1.1\n~~~', new Context())),
314
314
  [[html('table', [
315
315
  html('thead', [
316
316
  html('tr', [html('th', { class: 'highlight' }, '1.1')]),
@@ -319,7 +319,7 @@ describe('Unit: parser/block/extension/table', () => {
319
319
  html('tfoot'),
320
320
  ]).outerHTML], '']);
321
321
  assert.deepStrictEqual(
322
- inspect(parser('~~~table\n:! 1.1\n~~~'), ctx),
322
+ inspect(parser, input('~~~table\n:! 1.1\n~~~', new Context())),
323
323
  [[html('table', [
324
324
  html('thead'),
325
325
  html('tbody', [
@@ -328,7 +328,7 @@ describe('Unit: parser/block/extension/table', () => {
328
328
  html('tfoot'),
329
329
  ]).outerHTML], '']);
330
330
  assert.deepStrictEqual(
331
- inspect(parser('~~~table\n#! 1.1\n: 1.2\n~~~'), ctx),
331
+ inspect(parser, input('~~~table\n#! 1.1\n: 1.2\n~~~', new Context())),
332
332
  [[html('table', [
333
333
  html('thead'),
334
334
  html('tbody', [
@@ -340,7 +340,7 @@ describe('Unit: parser/block/extension/table', () => {
340
340
  html('tfoot'),
341
341
  ]).outerHTML], '']);
342
342
  assert.deepStrictEqual(
343
- inspect(parser('~~~table\n: 1.1\n#! 1.2\n~~~'), ctx),
343
+ inspect(parser, input('~~~table\n: 1.1\n#! 1.2\n~~~', new Context())),
344
344
  [[html('table', [
345
345
  html('thead'),
346
346
  html('tbody', [
@@ -352,7 +352,7 @@ describe('Unit: parser/block/extension/table', () => {
352
352
  html('tfoot'),
353
353
  ]).outerHTML], '']);
354
354
  assert.deepStrictEqual(
355
- inspect(parser('~~~table\n#! 1.1\n-\n: 2.1\n~~~'), ctx),
355
+ inspect(parser, input('~~~table\n#! 1.1\n-\n: 2.1\n~~~', new Context())),
356
356
  [[html('table', [
357
357
  html('thead', [
358
358
  html('tr', [html('th', { class: 'highlight' }, '1.1')]),
@@ -363,7 +363,7 @@ describe('Unit: parser/block/extension/table', () => {
363
363
  html('tfoot'),
364
364
  ]).outerHTML], '']);
365
365
  assert.deepStrictEqual(
366
- inspect(parser('~~~table\n#! 1.1\n-\n:!+ 2.1\n~~~'), ctx),
366
+ inspect(parser, input('~~~table\n#! 1.1\n-\n:!+ 2.1\n~~~', new Context())),
367
367
  [[html('table', [
368
368
  html('thead', [
369
369
  html('tr', [html('th', { class: 'highlight' }, '1.1')]),
@@ -374,7 +374,7 @@ describe('Unit: parser/block/extension/table', () => {
374
374
  html('tfoot'),
375
375
  ]).outerHTML], '']);
376
376
  assert.deepStrictEqual(
377
- inspect(parser('~~~table\n#!+ 1.1\n-\n: 2.1\n~~~'), ctx),
377
+ inspect(parser, input('~~~table\n#!+ 1.1\n-\n: 2.1\n~~~', new Context())),
378
378
  [[html('table', [
379
379
  html('thead', [
380
380
  html('tr', [html('th', { class: 'highlight', 'data-highlight-extension': '+' }, '1.1')]),
@@ -385,7 +385,7 @@ describe('Unit: parser/block/extension/table', () => {
385
385
  html('tfoot'),
386
386
  ]).outerHTML], '']);
387
387
  assert.deepStrictEqual(
388
- inspect(parser('~~~table\n#!+ 1.1\n# 1.2\n: 1.3\n~~~'), ctx),
388
+ inspect(parser, input('~~~table\n#!+ 1.1\n# 1.2\n: 1.3\n~~~', new Context())),
389
389
  [[html('table', [
390
390
  html('thead'),
391
391
  html('tbody', [
@@ -398,7 +398,7 @@ describe('Unit: parser/block/extension/table', () => {
398
398
  html('tfoot'),
399
399
  ]).outerHTML], '']);
400
400
  assert.deepStrictEqual(
401
- inspect(parser('~~~table\n: 1.1\n# 1.2\n#!+ 1.3\n~~~'), ctx),
401
+ inspect(parser, input('~~~table\n: 1.1\n# 1.2\n#!+ 1.3\n~~~', new Context())),
402
402
  [[html('table', [
403
403
  html('thead'),
404
404
  html('tbody', [
@@ -411,7 +411,7 @@ describe('Unit: parser/block/extension/table', () => {
411
411
  html('tfoot'),
412
412
  ]).outerHTML], '']);
413
413
  assert.deepStrictEqual(
414
- inspect(parser('~~~table\n#!+ 1.1\n-\n# 2.1\n-\n: 3.1\n~~~'), ctx),
414
+ inspect(parser, input('~~~table\n#!+ 1.1\n-\n# 2.1\n-\n: 3.1\n~~~', new Context())),
415
415
  [[html('table', [
416
416
  html('thead', [
417
417
  html('tr', [html('th', { class: 'highlight', 'data-highlight-extension': '+' }, '1.1')]),
@@ -423,7 +423,7 @@ describe('Unit: parser/block/extension/table', () => {
423
423
  html('tfoot'),
424
424
  ]).outerHTML], '']);
425
425
  assert.deepStrictEqual(
426
- inspect(parser('~~~table\n#:2!+ 1.1\n: 1.3\n~~~'), ctx),
426
+ inspect(parser, input('~~~table\n#:2!+ 1.1\n: 1.3\n~~~', new Context())),
427
427
  [[html('table', [
428
428
  html('thead'),
429
429
  html('tbody', [
@@ -435,7 +435,7 @@ describe('Unit: parser/block/extension/table', () => {
435
435
  html('tfoot'),
436
436
  ]).outerHTML], '']);
437
437
  assert.deepStrictEqual(
438
- inspect(parser('~~~table\n#2:!+ 1.1\n-\n: 3.1\n~~~'), ctx),
438
+ inspect(parser, input('~~~table\n#2:!+ 1.1\n-\n: 3.1\n~~~', new Context())),
439
439
  [[html('table', [
440
440
  html('thead', [
441
441
  html('tr', [html('th', { class: 'highlight', rowspan: '2', 'data-highlight-extension': '+' }, '1.1')]),
@@ -446,7 +446,7 @@ describe('Unit: parser/block/extension/table', () => {
446
446
  html('tfoot'),
447
447
  ]).outerHTML], '']);
448
448
  assert.deepStrictEqual(
449
- inspect(parser('~~~table\n-\n# \n#!+ 1.2\n-\n#!+ 2.1\n: 2.2\n~~~'), ctx),
449
+ inspect(parser, input('~~~table\n-\n# \n#!+ 1.2\n-\n#!+ 2.1\n: 2.2\n~~~', new Context())),
450
450
  [[html('table', [
451
451
  html('thead', [
452
452
  html('tr', [
@@ -463,7 +463,7 @@ describe('Unit: parser/block/extension/table', () => {
463
463
  html('tfoot'),
464
464
  ]).outerHTML], '']);
465
465
  assert.deepStrictEqual(
466
- inspect(parser('~~~table\n-\n# \n#!+ 1.2\n-\n#!+ 2.1\n:! 2.2\n~~~'), ctx),
466
+ inspect(parser, input('~~~table\n-\n# \n#!+ 1.2\n-\n#!+ 2.1\n:! 2.2\n~~~', new Context())),
467
467
  [[html('table', [
468
468
  html('thead', [
469
469
  html('tr', [
@@ -480,7 +480,7 @@ describe('Unit: parser/block/extension/table', () => {
480
480
  html('tfoot'),
481
481
  ]).outerHTML], '']);
482
482
  assert.deepStrictEqual(
483
- inspect(parser('~~~table\n-\n# 1.1\n#!+ 1.2\n-\n# 2.1\n:2:2 2.2\n: 2.4\n-\n#!+ 3.1\n: 3.4\n-\n# 4.1\n: 4.2\n~~~'), ctx),
483
+ inspect(parser, input('~~~table\n-\n# 1.1\n#!+ 1.2\n-\n# 2.1\n:2:2 2.2\n: 2.4\n-\n#!+ 3.1\n: 3.4\n-\n# 4.1\n: 4.2\n~~~', new Context())),
484
484
  [[html('table', [
485
485
  html('thead', [
486
486
  html('tr', [
@@ -506,7 +506,7 @@ describe('Unit: parser/block/extension/table', () => {
506
506
  html('tfoot'),
507
507
  ]).outerHTML], '']);
508
508
  assert.deepStrictEqual(
509
- inspect(parser('~~~table\n-\n# 1.1\n#:2!+ 1.2\n-\n#2:!+ 2.1\n: 2.2\n-\n3.2\n3.3\n~~~'), ctx),
509
+ inspect(parser, input('~~~table\n-\n# 1.1\n#:2!+ 1.2\n-\n#2:!+ 2.1\n: 2.2\n-\n3.2\n3.3\n~~~', new Context())),
510
510
  [[html('table', [
511
511
  html('thead', [
512
512
  html('tr', [
@@ -527,12 +527,12 @@ describe('Unit: parser/block/extension/table', () => {
527
527
  html('tfoot'),
528
528
  ]).outerHTML], '']);
529
529
  assert.deepStrictEqual(
530
- inspect(parser([
530
+ inspect(parser, input([
531
531
  '~~~table',
532
532
  `-\n# 1\n${[...Array(32)].map((_, i) => `: ${i + 2}`).join('\n')}`,
533
533
  `-\n#!+ 1\n${[...Array(32)].map((_, i) => `: ${i + 2}`).join('\n')}`,
534
534
  '~~~'
535
- ].join('\n')), ctx),
535
+ ].join('\n'), new Context())),
536
536
  [[html('table', [
537
537
  html('thead'),
538
538
  html('tbody', [
@@ -547,12 +547,12 @@ describe('Unit: parser/block/extension/table', () => {
547
547
  ]),
548
548
  html('tfoot')]).outerHTML], '']);
549
549
  assert.deepStrictEqual(
550
- inspect(parser([
550
+ inspect(parser, input([
551
551
  '~~~table',
552
552
  `-\n${[...Array(32)].map((_, i) => `: ${i + 1}`).join('\n')}\n# 33`,
553
553
  `-\n${[...Array(32)].map((_, i) => `: ${i + 1}`).join('\n')}\n#!+ 33`,
554
554
  '~~~'
555
- ].join('\n')), ctx),
555
+ ].join('\n'), new Context())),
556
556
  [[html('table', [
557
557
  html('thead'),
558
558
  html('tbody', [
@@ -567,12 +567,12 @@ describe('Unit: parser/block/extension/table', () => {
567
567
  ]),
568
568
  html('tfoot')]).outerHTML], '']);
569
569
  assert.deepStrictEqual(
570
- inspect(parser([
570
+ inspect(parser, input([
571
571
  '~~~table',
572
572
  `-\n${[...Array(32)].map((_, i) => `# ${i + 1}`).join('\n')}\n#!+ 33`,
573
573
  `-\n${[...Array(33)].map((_, i) => `: ${i + 1}`).join('\n')}`,
574
574
  '~~~'
575
- ].join('\n')), ctx),
575
+ ].join('\n'), new Context())),
576
576
  [[html('table', [
577
577
  html('thead', [
578
578
  html('tr', [
@@ -588,11 +588,11 @@ describe('Unit: parser/block/extension/table', () => {
588
588
  ]),
589
589
  html('tfoot')]).outerHTML], '']);
590
590
  assert.deepStrictEqual(
591
- inspect(parser([
591
+ inspect(parser, input([
592
592
  '~~~table',
593
593
  `${[...Array(7)].map((_, i) => `#${'!'.repeat(i + 1)} ${i + 1}`).join('\n')}`,
594
594
  '~~~'
595
- ].join('\n')), ctx),
595
+ ].join('\n'), new Context())),
596
596
  [[html('table', [
597
597
  html('thead', [
598
598
  html('tr', [
@@ -605,11 +605,11 @@ describe('Unit: parser/block/extension/table', () => {
605
605
  html('tfoot'),
606
606
  ]).outerHTML], '']);
607
607
  assert.deepStrictEqual(
608
- inspect(parser([
608
+ inspect(parser, input([
609
609
  '~~~table',
610
610
  `${[...Array(7)].map((_, i) => `:${'!'.repeat(i + 1)} ${i + 1}`).join('\n')}`,
611
611
  '~~~'
612
- ].join('\n')), ctx),
612
+ ].join('\n'), new Context())),
613
613
  [[html('table', [
614
614
  html('thead'),
615
615
  html('tbody', [
@@ -622,7 +622,7 @@ describe('Unit: parser/block/extension/table', () => {
622
622
  html('tfoot'),
623
623
  ]).outerHTML], '']);
624
624
  assert.deepStrictEqual(
625
- inspect(parser('~~~table\n#!+ 1\n: 2\n:! 3\n~~~'), ctx),
625
+ inspect(parser, input('~~~table\n#!+ 1\n: 2\n:! 3\n~~~', new Context())),
626
626
  [[html('table', [
627
627
  html('thead'),
628
628
  html('tbody', [
@@ -635,7 +635,7 @@ describe('Unit: parser/block/extension/table', () => {
635
635
  html('tfoot'),
636
636
  ]).outerHTML], '']);
637
637
  assert.deepStrictEqual(
638
- inspect(parser('~~~table\n! 1.1\n!!!!!! 1.2\n!!!!!!! 1.3\n~~~'), ctx),
638
+ inspect(parser, input('~~~table\n! 1.1\n!!!!!! 1.2\n!!!!!!! 1.3\n~~~', new Context())),
639
639
  [[html('table', [
640
640
  html('thead'),
641
641
  html('tbody', [
@@ -651,7 +651,7 @@ describe('Unit: parser/block/extension/table', () => {
651
651
 
652
652
  it('merge', () => {
653
653
  assert.deepStrictEqual(
654
- inspect(parser('~~~table\n:: 1.1\n~~~'), ctx),
654
+ inspect(parser, input('~~~table\n:: 1.1\n~~~', new Context())),
655
655
  [[html('table', [
656
656
  html('thead'),
657
657
  html('tbody', [
@@ -660,7 +660,7 @@ describe('Unit: parser/block/extension/table', () => {
660
660
  html('tfoot'),
661
661
  ]).outerHTML], '']);
662
662
  assert.deepStrictEqual(
663
- inspect(parser('~~~table\n:0:0 1.1\n~~~'), ctx),
663
+ inspect(parser, input('~~~table\n:0:0 1.1\n~~~', new Context())),
664
664
  [[html('table', [
665
665
  html('thead'),
666
666
  html('tbody', [
@@ -669,7 +669,7 @@ describe('Unit: parser/block/extension/table', () => {
669
669
  html('tfoot'),
670
670
  ]).outerHTML], '']);
671
671
  assert.deepStrictEqual(
672
- inspect(parser('~~~table\n:01:01 1.1\n~~~'), ctx),
672
+ inspect(parser, input('~~~table\n:01:01 1.1\n~~~', new Context())),
673
673
  [[html('table', [
674
674
  html('thead'),
675
675
  html('tbody', [
@@ -678,7 +678,7 @@ describe('Unit: parser/block/extension/table', () => {
678
678
  html('tfoot'),
679
679
  ]).outerHTML], '']);
680
680
  assert.deepStrictEqual(
681
- inspect(parser('~~~table\n:1:1 1.1\n~~~'), ctx),
681
+ inspect(parser, input('~~~table\n:1:1 1.1\n~~~', new Context())),
682
682
  [[html('table', [
683
683
  html('thead'),
684
684
  html('tbody', [
@@ -687,7 +687,7 @@ describe('Unit: parser/block/extension/table', () => {
687
687
  html('tfoot'),
688
688
  ]).outerHTML], '']);
689
689
  assert.deepStrictEqual(
690
- inspect(parser('~~~table\n:2: 1.1\n~~~'), ctx),
690
+ inspect(parser, input('~~~table\n:2: 1.1\n~~~', new Context())),
691
691
  [[html('table', [
692
692
  html('thead'),
693
693
  html('tbody', [
@@ -696,7 +696,7 @@ describe('Unit: parser/block/extension/table', () => {
696
696
  html('tfoot'),
697
697
  ]).outerHTML], '']);
698
698
  assert.deepStrictEqual(
699
- inspect(parser('~~~table\n::2 1.1\n~~~'), ctx),
699
+ inspect(parser, input('~~~table\n::2 1.1\n~~~', new Context())),
700
700
  [[html('table', [
701
701
  html('thead'),
702
702
  html('tbody', [
@@ -705,7 +705,7 @@ describe('Unit: parser/block/extension/table', () => {
705
705
  html('tfoot'),
706
706
  ]).outerHTML], '']);
707
707
  assert.deepStrictEqual(
708
- inspect(parser('~~~table\n:2:3 1.1\n~~~'), ctx),
708
+ inspect(parser, input('~~~table\n:2:3 1.1\n~~~', new Context())),
709
709
  [[html('table', [
710
710
  html('thead'),
711
711
  html('tbody', [
@@ -717,10 +717,10 @@ describe('Unit: parser/block/extension/table', () => {
717
717
 
718
718
  it('type', () => {
719
719
  assert.deepStrictEqual(
720
- inspect(parser('~~~table/invalid\n~~~'), ctx),
720
+ inspect(parser, input('~~~table/invalid\n~~~', new Context())),
721
721
  [['<pre class="invalid" translate="no">~~~table/invalid\n~~~</pre>'], '']);
722
722
  assert.deepStrictEqual(
723
- inspect(parser('~~~table/grid\n~~~'), ctx),
723
+ inspect(parser, input('~~~table/grid\n~~~', new Context())),
724
724
  [[html('table', { 'data-type': 'grid' }).outerHTML], '']);
725
725
  });
726
726