File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -176,13 +176,18 @@ async function markdownMagic(globOrOpts = {}, options = {}) {
176176 open = `${ opts . matchWord } :start`
177177 }
178178
179- let close = CLOSE_WORD
180- if ( opts . close ) {
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 ) {
181183 close = opts . close
182184 // @ts -ignore legacy
183185 } else if ( opts . matchWord ) {
184186 // @ts -ignore legacy
185187 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
186191 }
187192
188193 const cwd = opts . cwd || process . cwd ( )
You can’t perform that action at this time.
0 commit comments