diff --git a/asset/css/markbind.css b/asset/css/markbind.css
index bcf1cd275a..9334f9d900 100644
--- a/asset/css/markbind.css
+++ b/asset/css/markbind.css
@@ -46,6 +46,10 @@ pre > code.hljs[heading] {
text-align: right;
}
+.inline-markdown-heading {
+ line-height: 1.5;
+}
+
.code-block-content {
clear: both;
display: block;
diff --git a/docs/userGuide/syntax/code.mbdf b/docs/userGuide/syntax/code.mbdf
index cfb76b9c83..d30752f700 100644
--- a/docs/userGuide/syntax/code.mbdf
+++ b/docs/userGuide/syntax/code.mbdf
@@ -149,6 +149,25 @@ To add a heading, add the attribute `heading` with the heading text as the value
+Headings support inline Markdown, except for `Inline Code` and %%Dim%% text styles.
+
+
+
+
+```` {.no-line-numbers}
+```{heading="**Bold**, _Italic_, ___Bold and Italic___, ~~Strike through~~, ****Super Bold****, ++Underline++, ==Highlight==, :+1: :exclamation: :x: :construction:
We support page breaks"}
+
+```
+````
+
+
+
+```{heading="**Bold**, _Italic_, ___Bold and Italic___, ~~Strike through~~, ****Super Bold****, ++Underline++, ==Highlight==, :+1: :exclamation: :x: :construction:
We support page breaks"}
+
+```
+
+
+
##### Using multiple features
You can also use multiple features together, as shown below.
diff --git a/src/lib/markbind/src/lib/markdown-it/index.js b/src/lib/markbind/src/lib/markdown-it/index.js
index 3f057dee21..a22717f39c 100644
--- a/src/lib/markbind/src/lib/markdown-it/index.js
+++ b/src/lib/markbind/src/lib/markdown-it/index.js
@@ -136,8 +136,10 @@ markdownIt.renderer.rules.fence = (tokens, idx, options, env, slf) => {
const heading = token.attrGet('heading');
const codeBlockContent = `
${str}
`;
if (heading) {
+ const renderedHeading = markdownIt.renderInline(heading);
+ const headingStyle = (renderedHeading === heading) ? 'code-block-heading' : 'code-block-heading inline-markdown-heading';
return ''
- + `
${heading}
`
+ + `
${renderedHeading}
`
+ `
${codeBlockContent}
`
+ '
';
}
diff --git a/test/functional/test_site/expected/markbind/css/markbind.css b/test/functional/test_site/expected/markbind/css/markbind.css
index bcf1cd275a..9334f9d900 100644
--- a/test/functional/test_site/expected/markbind/css/markbind.css
+++ b/test/functional/test_site/expected/markbind/css/markbind.css
@@ -46,6 +46,10 @@ pre > code.hljs[heading] {
text-align: right;
}
+.inline-markdown-heading {
+ line-height: 1.5;
+}
+
.code-block-content {
clear: both;
display: block;
diff --git a/test/functional/test_site/expected/testCodeBlocks.html b/test/functional/test_site/expected/testCodeBlocks.html
index 46a7829fc7..56feb259b8 100644
--- a/test/functional/test_site/expected/testCodeBlocks.html
+++ b/test/functional/test_site/expected/testCodeBlocks.html
@@ -38,6 +38,20 @@
1 highlighted23 highlighted45 highlighted6 highlighted7 highlighted8 highlighted910
highlight-lines attr with start-from attr cause corresponding lines to have 'highlighted' class based on 'start-from'
11 highlighted1213 highlighted1415 highlighted16 highlighted17 highlighted18 highlighted1920
+ Code block heading
+
+ Code block heading with inline markdown
+
+
Bold, Italic, Bold and Italic, Strike through, Super Bold, Underline, Highlight, 👍 ❗️ ❌ 🚧
We support page breaks
+
+