@peaceroad/markown-figure-num-setting 0.1.0 → 0.1.1

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/index.js CHANGED
@@ -105,7 +105,7 @@ const setMarkdownFigureNum = (markdown, option) => {
105
105
  continue
106
106
  }
107
107
  if (lines[i].match(new RegExp(hasFigureImageReg))) {
108
- lines[i] = lines[i].replace(new RegExp(hasFigureImageReg), '$1$2' + label(hasMarkLabel, hasFigureImageReg) + counter[mark] + '$3')
108
+ lines[i] = lines[i].replace(new RegExp(hasFigureImageReg), '$1' + label(hasMarkLabel, hasFigureImageReg) + counter[mark] + '$3')
109
109
  hasNextFigureImage = true
110
110
  }
111
111
  break
@@ -118,7 +118,7 @@ const setMarkdownFigureNum = (markdown, option) => {
118
118
  continue
119
119
  }
120
120
  if (lines[i].match(new RegExp(hasFigureImageReg))) {
121
- lines[i] = lines[i].replace(new RegExp(hasFigureImageReg), '$1$2' + label(hasMarkLabel, hasFigureImageReg) + counter[mark] + '$3')
121
+ lines[i] = lines[i].replace(new RegExp(hasFigureImageReg), '$1' + label(hasMarkLabel, hasFigureImageReg) + counter[mark] + '$3')
122
122
  }
123
123
  break
124
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peaceroad/markown-figure-num-setting",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Set figure number of p7d-markdown-it-p-captions.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/test/examples.txt CHANGED
@@ -60,3 +60,34 @@
60
60
 
61
61
  段落。段落。段落。
62
62
 
63
+
64
+ [Input]
65
+ 段落。段落。段落。
66
+
67
+ 図 キャプション
68
+
69
+ ![図1](image.jpg)
70
+
71
+ 段落。段落。段落。
72
+
73
+ 図 キャプション
74
+
75
+ ![図2](image.jpg)
76
+
77
+ 段落。段落。段落。
78
+
79
+ [Output]
80
+ 段落。段落。段落。
81
+
82
+ 図1 キャプション
83
+
84
+ ![図1](image.jpg)
85
+
86
+ 段落。段落。段落。
87
+
88
+ 図2 キャプション
89
+
90
+ ![図2](image.jpg)
91
+
92
+ 段落。段落。段落。
93
+
package/test/test.js CHANGED
@@ -33,7 +33,7 @@ while(n < ms0.length) {
33
33
 
34
34
  n = 1;
35
35
  while(n < ms.length) {
36
- if (n !== 1) { n++; continue }
36
+ //if (n !== 1) { n++; continue }
37
37
  console.log('Test: ' + n + ' >>>')
38
38
  const m = ms[n].inputMarkdown
39
39
  const h = setMarkdownFigureNum(m)