@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 +2 -2
- package/package.json +1 -1
- package/test/examples.txt +31 -0
- package/test/test.js +1 -1
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
|
|
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
|
|
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
package/test/examples.txt
CHANGED
|
@@ -60,3 +60,34 @@
|
|
|
60
60
|
|
|
61
61
|
段落。段落。段落。
|
|
62
62
|
|
|
63
|
+
|
|
64
|
+
[Input]
|
|
65
|
+
段落。段落。段落。
|
|
66
|
+
|
|
67
|
+
図 キャプション
|
|
68
|
+
|
|
69
|
+

|
|
70
|
+
|
|
71
|
+
段落。段落。段落。
|
|
72
|
+
|
|
73
|
+
図 キャプション
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
段落。段落。段落。
|
|
78
|
+
|
|
79
|
+
[Output]
|
|
80
|
+
段落。段落。段落。
|
|
81
|
+
|
|
82
|
+
図1 キャプション
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
段落。段落。段落。
|
|
87
|
+
|
|
88
|
+
図2 キャプション
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
段落。段落。段落。
|
|
93
|
+
|
package/test/test.js
CHANGED