markdown-magic 4.5.8 → 4.6.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.
- package/package.json +4 -4
- package/src/index.js +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-magic",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.2",
|
|
4
4
|
"description": "Automatically update markdown files with content from external sources",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@davidwells/md-utils": "0.0.53",
|
|
44
44
|
"color-convert": "^2.0.1",
|
|
45
45
|
"comment-block-parser": "1.5.4",
|
|
46
|
-
"comment-block-replacer": "0.1.
|
|
47
|
-
"comment-block-transformer": "0.
|
|
46
|
+
"comment-block-replacer": "0.1.17",
|
|
47
|
+
"comment-block-transformer": "0.6.1",
|
|
48
48
|
"globrex": "^0.1.2",
|
|
49
49
|
"gray-matter": "^4.0.3",
|
|
50
50
|
"is-glob": "^4.0.3",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e149a2e69992f108553ed3f84dc5cbd1db361987"
|
|
74
74
|
}
|
package/src/index.js
CHANGED
|
@@ -297,14 +297,22 @@ async function markdownMagic(globOrOpts = {}, options = {}) {
|
|
|
297
297
|
|
|
298
298
|
|
|
299
299
|
// Pattern mode (close undefined) - parseBlocks handles regex generation
|
|
300
|
+
// Single comment mode (close === false) - no close tag
|
|
300
301
|
// Standard mode - get patterns for comment stripping
|
|
301
302
|
let patterns = {}
|
|
302
|
-
|
|
303
|
+
const singleCommentMode = close === false
|
|
304
|
+
if (close !== undefined && close !== false) {
|
|
303
305
|
patterns = getBlockRegex({
|
|
304
306
|
syntax,
|
|
305
307
|
openText: open,
|
|
306
308
|
closeText: close
|
|
307
309
|
})
|
|
310
|
+
} else if (singleCommentMode) {
|
|
311
|
+
patterns = getBlockRegex({
|
|
312
|
+
syntax,
|
|
313
|
+
openText: open,
|
|
314
|
+
singleComment: true
|
|
315
|
+
})
|
|
308
316
|
}
|
|
309
317
|
|
|
310
318
|
if (debug) {
|