markdown-magic 4.5.5 → 4.5.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/package.json +2 -2
- package/src/index.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-magic",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.6",
|
|
4
4
|
"description": "Automatically update markdown files with content from external sources",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "afb6fd2c43370c3e0e7e545739c9aa8540960096"
|
|
74
74
|
}
|
package/src/index.js
CHANGED
|
@@ -176,13 +176,18 @@ async function markdownMagic(globOrOpts = {}, options = {}) {
|
|
|
176
176
|
open = `${opts.matchWord}:start`
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
// When open is custom and close not specified, leave close undefined
|
|
180
|
+
// to enable pattern mode in block-parser (auto-generates close as /OpenTag)
|
|
181
|
+
let close
|
|
182
|
+
if (opts.close !== undefined) {
|
|
181
183
|
close = opts.close
|
|
182
184
|
// @ts-ignore legacy
|
|
183
185
|
} else if (opts.matchWord) {
|
|
184
186
|
// @ts-ignore legacy
|
|
185
187
|
close = `${opts.matchWord}:end`
|
|
188
|
+
} else if (!opts.open || opts.open === OPEN_WORD) {
|
|
189
|
+
// Only default to /docs when using default open word
|
|
190
|
+
close = CLOSE_WORD
|
|
186
191
|
}
|
|
187
192
|
|
|
188
193
|
const cwd = opts.cwd || process.cwd()
|