Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ lib-cov
logs
node_modules
temp
.history
2 changes: 1 addition & 1 deletion src/syntax/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
9 changes: 9 additions & 0 deletions test/input/16.blocks-headings-in-slots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
::step
### Step 1

Content for step 1.

### Step2

More content.
::
4 changes: 2 additions & 2 deletions test/output/1.basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ <h1>Hello</h1>
</blockquote>
<pre><code class="language-bash">npm i @comark/markdown-it
</code></pre>
<pre><code class="language-ts">import MarkdownIt from 'markdown-it'
import mdc from '@comark/markdown-it'
<pre><code class="language-ts">import mdc from '@comark/markdown-it'
import MarkdownIt from 'markdown-it'

// :warning: this line should not be transformed
const md = new MarkdownIt()
Expand Down
6 changes: 6 additions & 0 deletions test/output/16.blocks-headings-in-slots.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<step>
<h3>Step 1</h3>
<p>Content for step 1.</p>
<h3>Step2</h3>
<p>More content.</p>
</step>