markdown-magic 4.5.6 → 4.6.0

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/index.js +18 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-magic",
3
- "version": "4.5.6",
3
+ "version": "4.6.0",
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.13",
47
- "comment-block-transformer": "0.5.5",
46
+ "comment-block-replacer": "0.1.15",
47
+ "comment-block-transformer": "0.5.7",
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": "afb6fd2c43370c3e0e7e545739c9aa8540960096"
73
+ "gitHead": "cbaa34e454c7c183afa23e5baf80aba663b8c2aa"
74
74
  }
package/src/index.js CHANGED
@@ -296,11 +296,24 @@ async function markdownMagic(globOrOpts = {}, options = {}) {
296
296
 
297
297
 
298
298
 
299
- const patterns = getBlockRegex({
300
- syntax,
301
- openText: open,
302
- closeText: close
303
- })
299
+ // Pattern mode (close undefined) - parseBlocks handles regex generation
300
+ // Single comment mode (close === false) - no close tag
301
+ // Standard mode - get patterns for comment stripping
302
+ let patterns = {}
303
+ const singleCommentMode = close === false
304
+ if (close !== undefined && close !== false) {
305
+ patterns = getBlockRegex({
306
+ syntax,
307
+ openText: open,
308
+ closeText: close
309
+ })
310
+ } else if (singleCommentMode) {
311
+ patterns = getBlockRegex({
312
+ syntax,
313
+ openText: open,
314
+ singleComment: true
315
+ })
316
+ }
304
317
 
305
318
  if (debug) {
306
319
  console.log(`patterns:`, patterns)