Skip to content

Commit

Permalink
fix: update tests for nested directives approach
Browse files Browse the repository at this point in the history
  • Loading branch information
bent10 committed Sep 7, 2024
1 parent 5858907 commit 31752c2
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion packages/directive/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,31 @@ describe('createDirectives', () => {
\`\`\`
:::
::::
:::{.foo}
+++{.bar}
### Title
Content ![Image](/image.jpg), with code:
~~~python
num1 = 5
num2 = 3
sum = num1 + num2
print(f"The sum of {num1} and {num2} is {sum}")
~~~
+++
:::
`

const html = new Marked()
.use(
createDirectives([
...presetDirectiveConfigs,
{ level: 'container', marker: '::::' }
{ level: 'container', marker: '::::' },
{ level: 'container', marker: '[+]{3}' }
])
)
.parse(markdown)
Expand All @@ -55,6 +73,17 @@ describe('createDirectives', () => {
</code></pre>
</file>
</example>
<div class="foo">
<div class="bar">
<h3>Title</h3>
<p>Content <img src="/image.jpg" alt="Image">, with code:</p>
<pre><code class="language-python">num1 = 5
num2 = 3
sum = num1 + num2
print(f&quot;The sum of {num1} and {num2} is {sum}&quot;)
</code></pre>
</div>
</div>
"
`)
})
Expand Down

0 comments on commit 31752c2

Please sign in to comment.