@peaceroad/markown-figure-num-setting 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,95 +10,94 @@ setMarkdownFigureNum(markdownCont)
10
10
 
11
11
  ```
12
12
  [Input]
13
- 段落。段落。段落。
13
+ Paragraph.
14
14
 
15
- キャプション
15
+ Figure. A Caption
16
16
 
17
- ![](image.jpg)
17
+ ![A alt text.](image.jpg)
18
18
 
19
- 段落。段落。段落。
19
+ Paragraph.
20
20
 
21
- キャプション
21
+ Figure. A Caption
22
22
 
23
- ![](image.jpg)
23
+ ![A alt text.](image.jpg)
24
24
 
25
- 段落。段落。段落。
25
+ Paragraph.
26
26
 
27
27
  [Output]
28
- 段落。段落。段落。
29
-
30
- 図1 キャプション
28
+ Paragraph.
31
29
 
32
- ![図1](image.jpg)
30
+ Figure 1. A Caption
33
31
 
34
- 段落。段落。段落。
32
+ ![A alt text.](image.jpg)
35
33
 
36
- 図2 キャプション
34
+ Paragraph.
37
35
 
38
- ![図2](image.jpg)
36
+ Figure 2. A Caption
39
37
 
40
- 段落。段落。段落。
38
+ ![A alt text.](image.jpg)
41
39
 
40
+ Paragraph.
42
41
 
43
42
 
44
43
  [Input]
45
- 段落。段落。段落。
44
+ Paragraph.
46
45
 
47
- 1 キャプション
46
+ Figure 1. A Caption
48
47
 
49
- ![](image.jpg)
48
+ ![A alt text.](image.jpg)
50
49
 
51
- 段落。段落。段落。
50
+ Paragraph.
52
51
 
53
- 図2 キャプション
52
+ Figure 1. A Caption
54
53
 
55
- ![](image.jpg)
54
+ ![A alt text.](image.jpg)
56
55
 
57
- 段落。段落。段落。
56
+ Paragraph.
58
57
 
59
58
  [Output]
60
- 段落。段落。段落。
59
+ Paragraph.
61
60
 
62
- 1 キャプション
61
+ Figure 1. A Caption
63
62
 
64
- ![図1](image.jpg)
63
+ ![A alt text.](image.jpg)
65
64
 
66
- 段落。段落。段落。
65
+ Paragraph.
67
66
 
68
- 2 キャプション
67
+ Figure 2. A Caption
69
68
 
70
- ![図2](image.jpg)
69
+ ![A alt text.](image.jpg)
71
70
 
72
- 段落。段落。段落。
71
+ Paragraph.
73
72
 
74
73
 
75
74
  [Input]
76
75
  段落。段落。段落。
77
76
 
78
- Figure. キャプション
77
+ キャプション
79
78
 
80
- ![](image.jpg)
79
+ ![A alt text.](image.jpg)
81
80
 
82
81
  段落。段落。段落。
83
82
 
84
- Figure. キャプション
83
+ キャプション
85
84
 
86
- ![](image.jpg)
85
+ ![A alt text.](image.jpg)
87
86
 
88
87
  段落。段落。段落。
89
88
 
90
89
  [Output]
91
90
  段落。段落。段落。
92
91
 
93
- Figure1. キャプション
92
+ 図1 キャプション
94
93
 
95
- ![Figure 1](image.jpg)
94
+ ![A alt text.](image.jpg)
96
95
 
97
96
  段落。段落。段落。
98
97
 
99
- Figure 2. キャプション
98
+ 2 キャプション
100
99
 
101
- ![Figure 2](image.jpg)
100
+ ![A alt text.](image.jpg)
102
101
 
103
102
  段落。段落。段落。
104
103
  ```
@@ -106,8 +105,11 @@ Figure 2. キャプション
106
105
 
107
106
  ## Option
108
107
 
109
- ### noSetAlt
108
+ ### setNumberAlt
109
+
110
+ Default behavior leaves image alt text unchanged. Set `setNumberAlt: true` to add the label number to alt.
110
111
 
112
+ ```
111
113
  [Input]
112
114
  図 キャプション
113
115
 
@@ -120,8 +122,9 @@ Figure 2. キャプション
120
122
  [Output]
121
123
  図1 キャプション
122
124
 
123
- ![ALT-A](image.jpg)
125
+ ![図1](image.jpg)
124
126
 
125
127
  図2 キャプション
126
128
 
127
- ![ALT-B](image.jpg)
129
+ ![図2](image.jpg)
130
+ ```
package/index.js CHANGED
@@ -2,92 +2,73 @@ import { markReg as markRegEx, joint as jointStr } from "p7d-markdown-it-p-capti
2
2
 
3
3
 
4
4
  const markReg = markRegEx
5
+ const markRegKeys = Object.keys(markReg)
5
6
  const joint = jointStr
7
+ const jointSuffixCaptureReg = new RegExp('(' + joint + ')$')
8
+ const asciiAlphaStartReg = /^[A-Za-z]/
9
+ const blankLineReg = /^[ \t]*$/
10
+ const figureImageReg = /^([ \t]*\!\[) *?(.*?([0-9]*)) *?(\]\(.*?\))/
6
11
  //console.log(markReg)
7
12
  //console.log(joint)
8
13
 
9
- const label = (hasMarkLabel, counter, isAlt) => {
10
- let label = hasMarkLabel[0]
11
- //console.log('label: ' + label + ' counter: ' + counter)
12
- let LabelIsEn = /^[a-zA-Z]/.test(label)
13
- const spaceBeforeCounter = LabelIsEn ? ' ' : ''
14
-
15
- //console.log(hasMarkLabel)
16
- if (hasMarkLabel[3]) {
17
- label = hasMarkLabel[0].replace(new RegExp(hasMarkLabel[3] + '$'), '')
18
- } else if (hasMarkLabel[4]) {
19
- label = hasMarkLabel[4]
14
+ const getLabelInfo = (hasMarkLabel) => {
15
+ const markLabel = hasMarkLabel[1] !== undefined
16
+ ? hasMarkLabel[1]
17
+ : hasMarkLabel[4] !== undefined
18
+ ? hasMarkLabel[4]
19
+ : hasMarkLabel[0]
20
+ const jointMatch = hasMarkLabel[0].match(jointSuffixCaptureReg)
21
+ return {
22
+ markLabel,
23
+ joint: jointMatch ? jointMatch[1] : '',
24
+ needsSpace: asciiAlphaStartReg.test(markLabel),
20
25
  }
21
- let hasLabelLastJoint = hasMarkLabel[0].match(new RegExp('(' + joint +')$'))
26
+ }
22
27
 
23
- if (hasLabelLastJoint) {
24
- if (isAlt) {
25
- label = label.replace(new RegExp(joint +'$'), '') + spaceBeforeCounter + counter
26
- } else {
27
- label = label.replace(new RegExp(joint +'$'), '') + spaceBeforeCounter + counter + hasLabelLastJoint[1]
28
- }
29
- } else {
30
- label += counter
28
+ const buildLabel = (labelInfo, counter, isAlt) => {
29
+ let label = labelInfo.markLabel + (labelInfo.needsSpace ? ' ' : '') + counter
30
+ if (!isAlt && labelInfo.joint) {
31
+ label += labelInfo.joint
31
32
  }
32
- //console.log('label: ' + label)
33
33
  return label
34
34
  }
35
35
 
36
36
 
37
- const setImageAltNumber = (lines, n, mark, hasMarkLabel, counter) => {
38
- let hasPrevFigureImage = false
39
- let isFigureImage
40
- const figureImageReg = /^([ \t]*\!\[) *?(.*?([0-9]*)) *?(\]\(.*?\))/
41
- let i
42
- i = n - 1
43
- //console.log('lines[n]: ' + lines[n])
44
- //console.log('CheckPrevLine')
45
- while (i >= 0) {
46
- if (/^[ \t]*$/.test(lines[i])) {
47
- i--
48
- continue
49
- }
50
- isFigureImage = lines[i].match(new RegExp(figureImageReg))
51
- if (!isFigureImage) break
52
-
53
- let j = i
54
- while (j >= 0) {
55
- if (/^[ \t]*$/.test(lines[j])) {
56
- j--
57
- continue
58
- }
59
- //console.log(isFigureImage[3], (counter.img - 1).toString())
60
- if (isFigureImage[3] === (counter.img - 1).toString()) {
61
- hasPrevFigureImage = false
62
- break
63
- }
64
- lines[i] = lines[i].replace(new RegExp(figureImageReg), '$1' + label(hasMarkLabel, counter[mark], true) + '$4')
37
+ const setImageAltNumber = (lines, n, currentNumber, altLabel) => {
38
+ const prevNumber = currentNumber - 1
39
+ let i = n - 1
40
+ //console.log('lines[n]: ' + lines[n])
41
+ //console.log('CheckPrevLine')
42
+ while (i >= 0 && blankLineReg.test(lines[i])) {
43
+ i--
44
+ }
45
+ if (i >= 0) {
46
+ const isFigureImage = lines[i].match(figureImageReg)
47
+ if (isFigureImage) {
48
+ //console.log(isFigureImage[3], prevNumber.toString())
49
+ if (isFigureImage[3] !== prevNumber.toString()) {
50
+ lines[i] = lines[i].replace(figureImageReg, '$1' + altLabel + '$4')
65
51
  //console.log('ChangePrevLine: ' + lines[i])
66
- hasPrevFigureImage = true
67
- break
52
+ return
68
53
  }
69
- break
70
54
  }
55
+ }
71
56
 
72
- if (hasPrevFigureImage) return
73
-
74
- //console.log('CheckNextLine')
75
- i = n + 1
76
- while (i < lines.length) {
77
- if (/^[\t ]*$/.test(lines[i])) {
78
- i++
79
- continue
80
- }
81
- isFigureImage = lines[i].match(new RegExp(figureImageReg))
82
- //console.log(isFigureImage)
83
- if (isFigureImage) {
84
- lines[i] = lines[i].replace(new RegExp(figureImageReg), '$1' + label(hasMarkLabel, counter[mark], true) + '$4')
85
- //console.log('ChangeNextLine: ' + lines[i])
86
- }
87
- break
57
+ //console.log('CheckNextLine')
58
+ i = n + 1
59
+ while (i < lines.length && blankLineReg.test(lines[i])) {
60
+ i++
61
+ }
62
+ if (i < lines.length) {
63
+ const isFigureImage = lines[i].match(figureImageReg)
64
+ //console.log(isFigureImage)
65
+ if (isFigureImage) {
66
+ lines[i] = lines[i].replace(figureImageReg, '$1' + altLabel + '$4')
67
+ //console.log('ChangeNextLine: ' + lines[i])
88
68
  }
89
- return
90
69
  }
70
+ return
71
+ }
91
72
 
92
73
  const setMarkdownFigureNum = (markdown, option) => {
93
74
  let opt = {
@@ -97,10 +78,12 @@ const setMarkdownFigureNum = (markdown, option) => {
97
78
  'pre-samp': false,
98
79
  blockquote: false,
99
80
  slide: false,
100
- noSetAlt: false,
81
+ noSetAlt: true,
82
+ setNumberAlt: false,
101
83
  setImgAlt: false,
102
84
  }
103
85
  if (option) Object.assign(opt, option)
86
+ const shouldSetAlt = opt.setNumberAlt || opt.setImgAlt || opt.noSetAlt === false
104
87
 
105
88
  let n = 0
106
89
  let lines = []
@@ -150,14 +133,17 @@ const setMarkdownFigureNum = (markdown, option) => {
150
133
  }
151
134
 
152
135
  //console.log('====== n: ' + n + ' lines[n]: ' + lines[n])
153
- for (let mark of Object.keys(markReg)) {
136
+ for (let mark of markRegKeys) {
154
137
  const hasMarkLabel = lines[n].match(markReg[mark])
155
138
  if (hasMarkLabel && opt[mark]) {
156
139
  //console.log(hasMarkLabel)
157
140
  counter[mark]++
158
- lines[n] = lines[n].replace(new RegExp('^([ \t]*)' + hasMarkLabel[0]), '$1' + label(hasMarkLabel, counter[mark]))
159
- if (mark === 'img' && !opt.noSetAlt) {
160
- setImageAltNumber(lines, n, mark, hasMarkLabel, counter)
141
+ const labelInfo = getLabelInfo(hasMarkLabel)
142
+ const captionLabel = buildLabel(labelInfo, counter[mark], false)
143
+ lines[n] = lines[n].replace(hasMarkLabel[0], () => captionLabel)
144
+ if (mark === 'img' && shouldSetAlt) {
145
+ const altLabel = buildLabel(labelInfo, counter[mark], true)
146
+ setImageAltNumber(lines, n, counter[mark], altLabel)
161
147
  }
162
148
  }
163
149
  }
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@peaceroad/markown-figure-num-setting",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Set figure number for p7d-markdown-it-p-captions.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
+ "files": [
8
+ "index.js",
9
+ "README.md",
10
+ "LICENSE"
11
+ ],
7
12
  "scripts": {
8
13
  "test": "node test/test.js"
9
14
  },
@@ -18,6 +23,6 @@
18
23
  },
19
24
  "homepage": "https://github.com/peaceroad/markown-figure-num-setting#readme",
20
25
  "dependencies": {
21
- "p7d-markdown-it-p-captions": "^0.17.0"
26
+ "p7d-markdown-it-p-captions": "^0.20.0"
22
27
  }
23
28
  }
@@ -1,55 +0,0 @@
1
- [Input]
2
- 図 キャプション
3
-
4
- ![ALT-A](image.jpg)
5
-
6
- 図 キャプション
7
-
8
- ![ALT-B](image.jpg)
9
-
10
- [Output]
11
- 図1 キャプション
12
-
13
- ![ALT-A](image.jpg)
14
-
15
- 図2 キャプション
16
-
17
- ![ALT-B](image.jpg)
18
-
19
-
20
- [Input]
21
- 図3 キャプション
22
-
23
- ![ALT-A](image.jpg)
24
-
25
- 図6 キャプション
26
-
27
- ![ALT-B](image.jpg)
28
-
29
- [Output]
30
- 図1 キャプション
31
-
32
- ![ALT-A](image.jpg)
33
-
34
- 図2 キャプション
35
-
36
- ![ALT-B](image.jpg)
37
-
38
-
39
- [Input]
40
- 図 キャプション
41
-
42
- ![](image.jpg)
43
-
44
- 図 キャプション
45
-
46
- ![](image.jpg)
47
-
48
- [Output]
49
- 図1 キャプション
50
-
51
- ![](image.jpg)
52
-
53
- 図2 キャプション
54
-
55
- ![](image.jpg)
package/test/examples.txt DELETED
@@ -1,348 +0,0 @@
1
- [Input]
2
- 段落。段落。段落。
3
-
4
- 図 キャプション
5
-
6
- ![](image.jpg)
7
-
8
- 段落。段落。段落。
9
-
10
- 図 キャプション
11
-
12
- ![](image.jpg)
13
-
14
- 段落。段落。段落。
15
-
16
- [Output]
17
- 段落。段落。段落。
18
-
19
- 図1 キャプション
20
-
21
- ![図1](image.jpg)
22
-
23
- 段落。段落。段落。
24
-
25
- 図2 キャプション
26
-
27
- ![図2](image.jpg)
28
-
29
- 段落。段落。段落。
30
-
31
-
32
-
33
- [Input]
34
- 段落。段落。段落。
35
-
36
- 図1 キャプション
37
-
38
- ![](image.jpg)
39
-
40
- 段落。段落。段落。
41
-
42
- 図3 キャプション
43
-
44
- ![](image.jpg)
45
-
46
- 段落。段落。段落。
47
-
48
- [Output]
49
- 段落。段落。段落。
50
-
51
- 図1 キャプション
52
-
53
- ![図1](image.jpg)
54
-
55
- 段落。段落。段落。
56
-
57
- 図2 キャプション
58
-
59
- ![図2](image.jpg)
60
-
61
- 段落。段落。段落。
62
-
63
-
64
-
65
- [Input]
66
- 図 キャプション
67
-
68
- ![図1](image.jpg)
69
-
70
- 図 キャプション
71
-
72
- ![図2](image.jpg)
73
-
74
- [Output]
75
- 図1 キャプション
76
-
77
- ![図1](image.jpg)
78
-
79
- 図2 キャプション
80
-
81
- ![図2](image.jpg)
82
-
83
-
84
-
85
- [Input]
86
- ![図1](image.jpg)
87
-
88
- 図 キャプション
89
-
90
- ![図2](image.jpg)
91
-
92
- 図 キャプション
93
- [Output]
94
- ![図1](image.jpg)
95
-
96
- 図1 キャプション
97
-
98
- ![図2](image.jpg)
99
-
100
- 図2 キャプション
101
-
102
- [Input]
103
- 段落。段落。段落。
104
-
105
- ```
106
- 図 キャプション
107
-
108
- ![図1](image.jpg)
109
- ```
110
-
111
- ```
112
- Code. Caption
113
- ```
114
-
115
- 段落。段落。段落。
116
-
117
- [Output]
118
- 段落。段落。段落。
119
-
120
- ```
121
- 図 キャプション
122
-
123
- ![図1](image.jpg)
124
- ```
125
-
126
- ```
127
- Code. Caption
128
- ```
129
-
130
- 段落。段落。段落。
131
-
132
-
133
- [Input]
134
- 段落。段落。段落。
135
-
136
- Figure. キャプション
137
-
138
- ![](image.jpg)
139
-
140
- 段落。段落。段落。
141
-
142
- Figure. キャプション
143
-
144
- ![](image.jpg)
145
-
146
- 段落。段落。段落。
147
-
148
- [Output]
149
- 段落。段落。段落。
150
-
151
- Figure 1. キャプション
152
-
153
- ![Figure 1](image.jpg)
154
-
155
- 段落。段落。段落。
156
-
157
- Figure 2. キャプション
158
-
159
- ![Figure 2](image.jpg)
160
-
161
- 段落。段落。段落。
162
-
163
-
164
- [Input]
165
- 図 キャプション
166
-
167
- ![](image.jpg)
168
-
169
- 図 キャプション
170
-
171
- ![](image.jpg)
172
-
173
- [Output]
174
- 図1 キャプション
175
-
176
- ![図1](image.jpg)
177
-
178
- 図2 キャプション
179
-
180
- ![図2](image.jpg)
181
-
182
-
183
- [Input]
184
- ![](image.jpg)
185
-
186
- 図 キャプション
187
-
188
- ![](image.jpg)
189
-
190
- 図 キャプション
191
- [Output]
192
- ![図1](image.jpg)
193
-
194
- 図1 キャプション
195
-
196
- ![図2](image.jpg)
197
-
198
- 図2 キャプション
199
-
200
-
201
-
202
- [Input]
203
- 図 キャプション
204
-
205
- ![](image.jpg)
206
-
207
- 図 キャプション
208
-
209
- ![](image.jpg)
210
- [Output]
211
- 図1 キャプション
212
-
213
- ![図1](image.jpg)
214
-
215
- 図2 キャプション
216
-
217
- ![図2](image.jpg)
218
-
219
-
220
- [Input]
221
-
222
-
223
- ![](image.jpg)
224
-
225
-
226
-
227
- ![](image.jpg)
228
- [Output]
229
-
230
-
231
- ![](image.jpg)
232
-
233
-
234
-
235
- ![](image.jpg)
236
-
237
-
238
- [Input]
239
- 図 
240
-
241
- ![](image.jpg)
242
-
243
- 図 
244
-
245
- ![](image.jpg)
246
- [Output]
247
- 図1 
248
-
249
- ![図1](image.jpg)
250
-
251
- 図2 
252
-
253
- ![図2](image.jpg)
254
-
255
- [Input]
256
-
257
-
258
- ![](image.jpg)
259
-
260
-
261
-
262
- ![](image.jpg)
263
- [Output]
264
- 図1
265
-
266
- ![図1](image.jpg)
267
-
268
- 図2
269
-
270
- ![図2](image.jpg)
271
-
272
-
273
- [Input]
274
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
275
-
276
- 図1 キャプション
277
-
278
- ![図1](Src)
279
-
280
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
281
-
282
- 図2 キャプション
283
-
284
- ![図2](Src)
285
-
286
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
287
-
288
- 図 キャプション
289
-
290
- ![図](Src)
291
-
292
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
293
-
294
- 図2 キャプション
295
-
296
- ![図2](Src)
297
-
298
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
299
-
300
- 図 キャプション
301
-
302
- ![図](Src)
303
-
304
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
305
-
306
- 図2 キャプション
307
-
308
- ![図2](Src)
309
-
310
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
311
- [Output]
312
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
313
-
314
- 図1 キャプション
315
-
316
- ![図1](Src)
317
-
318
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
319
-
320
- 図2 キャプション
321
-
322
- ![図2](Src)
323
-
324
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
325
-
326
- 図3 キャプション
327
-
328
- ![図3](Src)
329
-
330
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
331
-
332
- 図4 キャプション
333
-
334
- ![図4](Src)
335
-
336
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
337
-
338
- 図5 キャプション
339
-
340
- ![図5](Src)
341
-
342
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
343
-
344
- 図6 キャプション
345
-
346
- ![図6](Src)
347
-
348
- 段落。段落。段落。段落。段落。段落。段落。段落。段落。
package/test/test.js DELETED
@@ -1,76 +0,0 @@
1
- import assert from 'assert'
2
- import fs from 'fs'
3
- import path from 'path'
4
- import setMarkdownFigureNum from '../index.js'
5
- import setMarkdownFigureNumWithNoSetAlt from '../index.js'
6
-
7
- let __dirname = path.dirname(new URL(import.meta.url).pathname)
8
- const isWindows = (process.platform === 'win32')
9
- if (isWindows) {
10
- __dirname = __dirname.replace(/^\/+/, '').replace(/\//g, '\\')
11
- }
12
-
13
- let pass = true
14
-
15
- const check = (name, ex) => {
16
- const exCont = fs.readFileSync(ex, 'utf-8').trim()
17
- let ms = [];
18
- let ms0 = exCont.split(/\n*\[Input\]\n/)
19
- let n = 1;
20
- while(n < ms0.length) {
21
- let mhs = ms0[n].split(/\n+\[Output[^\]]*?\]\n/)
22
- let i = 1
23
- while (i < 2) {
24
- if (mhs[i] === undefined) {
25
- mhs[i] = ''
26
- } else {
27
- mhs[i] = mhs[i].replace(/$/,'\n')
28
- }
29
- i++
30
- }
31
- ms[n] = {
32
- inputMarkdown: mhs[0].trim(),
33
- outputMarkdown: mhs[1].trim(),
34
- };
35
- n++
36
- }
37
-
38
- n = 1
39
- while(n < ms.length) {
40
- //if (n !== 11) {n++; continue }
41
- console.log('Test: ' + n + ' >>>')
42
- const m = ms[n].inputMarkdown
43
- let h
44
- let option = {}
45
- if (name === 'default') {
46
- h = setMarkdownFigureNum(m)
47
- }
48
- if (name === 'noSetAlt') {
49
- option.noSetAlt = true
50
- h = setMarkdownFigureNumWithNoSetAlt(m, option)
51
- }
52
-
53
- try {
54
- assert.strictEqual(h, ms[n].outputMarkdown)
55
- } catch(e) {
56
- pass = false
57
- console.log('incorrect: ')
58
- console.log(m)
59
- console.log('::convert ->')
60
- console.log('H: ' + h +'\n\nC: ' + ms[n].outputMarkdown)
61
- }
62
- n++
63
- }
64
- }
65
-
66
-
67
- const example = {
68
- default: __dirname + path.sep + 'examples.txt',
69
- noSetAlt: __dirname + path.sep + 'examples-no-set-alt.txt',
70
- }
71
- for (let ex in example) {
72
- console.log('[' + ex + '] >>> ' + example[ex])
73
- check(ex, example[ex])
74
- }
75
-
76
- if (pass) console.log('\nAll tests passed.')