diff --git a/.gitignore b/.gitignore index 95f9ee9..5febb39 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ lib-cov logs node_modules temp +.history diff --git a/src/syntax/block.ts b/src/syntax/block.ts index 49d7abc..40f3de1 100644 --- a/src/syntax/block.ts +++ b/src/syntax/block.ts @@ -329,7 +329,7 @@ export const MarkdownItMdcBlock: MarkdownIt.PluginSimple = (md) => { const start = state.bMarks[startLine] + state.tShift[startLine] - if (!(state.src[start] === '#' && state.src[start + 1] !== ' ')) + if (!(state.src[start] === '#' && state.src[start + 1] !== ' ' && state.src[start + 1] !== '#')) return false const line = state.src.slice(start, state.eMarks[startLine]) diff --git a/test/input/16.blocks-headings-in-slots.md b/test/input/16.blocks-headings-in-slots.md new file mode 100644 index 0000000..7931e4f --- /dev/null +++ b/test/input/16.blocks-headings-in-slots.md @@ -0,0 +1,9 @@ +::step +### Step 1 + +Content for step 1. + +### Step2 + +More content. +:: diff --git a/test/output/1.basic.html b/test/output/1.basic.html index 3ff1823..db6ad36 100644 --- a/test/output/1.basic.html +++ b/test/output/1.basic.html @@ -14,8 +14,8 @@

Hello

npm i @comark/markdown-it
 
-
import MarkdownIt from 'markdown-it'
-import mdc from '@comark/markdown-it'
+
import mdc from '@comark/markdown-it'
+import MarkdownIt from 'markdown-it'
 
 // :warning: this line should not be transformed
 const md = new MarkdownIt()
diff --git a/test/output/16.blocks-headings-in-slots.html b/test/output/16.blocks-headings-in-slots.html
new file mode 100644
index 0000000..bb7838b
--- /dev/null
+++ b/test/output/16.blocks-headings-in-slots.html
@@ -0,0 +1,6 @@
+
+  

Step 1

+

Content for step 1.

+

Step2

+

More content.

+
\ No newline at end of file