diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 21bdbf3..d6e3d44 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -85,3 +85,7 @@ jobs:
- name: Test
run: nr test
+
+ - name: Publish
+ if: runner.os == 'Linux'
+ run: pnpx pkg-pr-new publish --compact --no-template --pnpm
diff --git a/src/syntax/block.ts b/src/syntax/block.ts
index 40f3de1..e6d83da 100644
--- a/src/syntax/block.ts
+++ b/src/syntax/block.ts
@@ -47,10 +47,8 @@ export const MarkdownItMdcBlock: MarkdownIt.PluginSimple = (md) => {
// Create inline container for the content
const inline = state.push('inline', '', 0)
- inline.content = ''
- const text = new state.Token('text', '', 0)
- text.content = content
- inline.children = [text]
+ inline.content = content
+ inline.children = []
const tokenClose = state.push('mdc_block_shorthand', name, -1)
tokenClose.map = [startLine, startLine + 1]
@@ -235,6 +233,16 @@ export const MarkdownItMdcBlock: MarkdownIt.PluginSimple = (md) => {
})
}
+ // Add bracket content as first paragraph `::bloc[Content]\n::`
+ if (params.content !== undefined) {
+ const pOpen = state.push('paragraph_open', 'p', 1)
+ pOpen.map = [startLine, startLine + 1]
+ const inline = state.push('inline', '', 0)
+ inline.content = params.content
+ inline.children = []
+ state.push('paragraph_close', 'p', -1)
+ }
+
// Parse content
const blkIndent = state.blkIndent
state.blkIndent = indent
diff --git a/src/syntax/inline-component.ts b/src/syntax/inline-component.ts
index c40b44f..a38c35a 100644
--- a/src/syntax/inline-component.ts
+++ b/src/syntax/inline-component.ts
@@ -23,7 +23,8 @@ export const MarkdownItInlineComponent: MarkdownIt.PluginWithOptions Hello World Hello {{ world }} ${foo} {{ bar }} {{ Foo Content for step 1. More content.
+ Hello Important Notice The label contains inline content but the body has block content. This will be rendered inside the Hello
.mdc-button {
background-color: #ff0000;
}
-
\ No newline at end of file
+
diff --git a/test/output/10.blocks-yaml.html b/test/output/10.blocks-yaml.html
index 9ae6a67..b31a4ee 100644
--- a/test/output/10.blocks-yaml.html
+++ b/test/output/10.blocks-yaml.html
@@ -10,4 +10,4 @@ Hello World
Foo {{ 1 + 1 }}
b ${a} }}{foo}{foo}
\ No newline at end of file
+
diff --git a/test/output/15.blocks-codeblock.html b/test/output/15.blocks-codeblock.html
index a95459b..c7d7f06 100644
--- a/test/output/15.blocks-codeblock.html
+++ b/test/output/15.blocks-codeblock.html
@@ -6,4 +6,4 @@ Title
This is a paragraph
-
\ No newline at end of file
+
diff --git a/test/output/16.blocks-headings-in-slots.html b/test/output/16.blocks-headings-in-slots.html
index bb7838b..d714239 100644
--- a/test/output/16.blocks-headings-in-slots.html
+++ b/test/output/16.blocks-headings-in-slots.html
@@ -3,4 +3,4 @@ Step 1
Step2
Hello
Title
description slot.
\ No newline at end of file
+
diff --git a/test/output/5.blocks-props.html b/test/output/5.blocks-props.html
index 7529a18..d2d944c 100644
--- a/test/output/5.blocks-props.html
+++ b/test/output/5.blocks-props.html
@@ -1,2 +1,2 @@
::hero
Indent 4 spaces, should be treated as code block
::
-Hello
-Hello
code
italic
-bold!
\ No newline at end of file +bold!
diff --git a/test/output/7.inline-components.html b/test/output/7.inline-components.html index 6a69883..f0cdaab 100644 --- a/test/output/7.inline-components.html +++ b/test/output/7.inline-components.html @@ -23,4 +23,4 @@Hello World
Hello World!
Hello World] Yes!
-Hello World!
\ No newline at end of file +Hello World!
diff --git a/test/output/9.blocks-slots.html b/test/output/9.blocks-slots.html index 875fb34..f0a39d5 100644 --- a/test/output/9.blocks-slots.html +++ b/test/output/9.blocks-slots.html @@ -13,4 +13,4 @@