diff --git a/test/functional/test_site/expected/siteData.json b/test/functional/test_site/expected/siteData.json index 93996138de..f5b71b94c5 100644 --- a/test/functional/test_site/expected/siteData.json +++ b/test/functional/test_site/expected/siteData.json @@ -271,7 +271,7 @@ }, { "src": "testCodeBlocks.md", - "title": "Code Blocks Line Splitting", + "title": "Test: Code Blocks", "layout": "default", "globalOverrideProperty": "Overridden by global override", "globalAndFrontMatterOverrideProperty": "Overridden by global override", diff --git a/test/functional/test_site/expected/testCodeBlocks.html b/test/functional/test_site/expected/testCodeBlocks.html index 72c28267a5..a6bf1326da 100644 --- a/test/functional/test_site/expected/testCodeBlocks.html +++ b/test/functional/test_site/expected/testCodeBlocks.html @@ -7,7 +7,7 @@ - Code Blocks Line Splitting + Test: Code Blocks @@ -26,33 +26,41 @@
-

Code blocks test

-

Multiple linebreaks, no highlight

-
Four empty lines below




Four empty lines above
-

Multiple linebreaks, with highlight

-
function fourEmptyLinesBelow() {




} // four empty lines above
-

hljs span spanning multiple lines

-
*****
-----
-

start-from attr causes inline style to be set

+

Test: Code blocks

+

Normal fenced code should render correctly

+
Content in a fenced code block
+

With syntax coloring should render correctly

+
<foo>
<bar type="name">goo</bar>
</foo>
+

no-line-numbers attr should hide corresponding line numbers

+
<foo>
<bar type="name">goo</bar>
</foo>
+

start-from attr should set inline css in <code> tag, enabling lines to start from a specific line number

*****
-----
-

highlight-lines attr causes corresponding lines to have 'highlighted' class

+

highlight-lines attr causes corresponding lines to have 'highlighted' class

1  highlighted
2
3 highlighted
4
5 highlighted
6 highlighted
7 highlighted
8 highlighted
9
10
-

highlight-lines attr with start-from attr cause corresponding lines to have 'highlighted' class based on 'start-from'

+

highlight-lines attr with start-from attr should cause corresponding lines to have 'highlighted' class based on start-from

11  highlighted
12
13 highlighted
14
15 highlighted
16 highlighted
17 highlighted
18 highlighted
19
20
-

Code block heading

+

Should render correctly with heading

A heading
<foo>
<bar>
</foo>
-

Code block heading with inline markdown

+

Inline markdown contained in heading should also be rendered correctly

Bold, Italic, Bold and Italic, Strike through, Super Bold, Underline, Highlight, 👍 ❗️ ❌ 🚧
We support page breaks
<foo>
<bar>
</foo>
+

Code block with multiple linebreaks should not have the empty lines collapsed

+

Four empty lines below, one above




Four empty lines above, one below

+

Code block without line numbers and multiple linebreaks should not have the empty lines collapsed

+

Four empty lines below, one above




Four empty lines above, one below

+

Code block with syntax highlighting and multiple linebreaks should not have the empty lines collapsed

+

function fourEmptyLinesBelowOneAbove() {




} // four empty lines above, one below

+

span with hljs class should span multiple lines (Link for context)

+
*****
-----
diff --git a/test/functional/test_site/site.json b/test/functional/test_site/site.json index e2cad0b199..e0c0f08afa 100644 --- a/test/functional/test_site/site.json +++ b/test/functional/test_site/site.json @@ -66,7 +66,7 @@ }, { "src": "testCodeBlocks.md", - "title": "Code Blocks Line Splitting" + "title": "Test: Code Blocks" }, { "src": "testIncludePluginsRendered.md", diff --git a/test/functional/test_site/testCodeBlocks.md b/test/functional/test_site/testCodeBlocks.md index 1381fd62df..a5605b5b13 100644 --- a/test/functional/test_site/testCodeBlocks.md +++ b/test/functional/test_site/testCodeBlocks.md @@ -1,41 +1,34 @@ -**Code blocks test** +**Test: Code blocks** -**Multiple linebreaks, no highlight** +**Normal fenced code should render correctly** ``` -Four empty lines below - - - - -Four empty lines above +Content in a fenced code block ``` -**Multiple linebreaks, with highlight** - -```js -function fourEmptyLinesBelow() { - +**With syntax coloring should render correctly** - - -} // four empty lines above +```xml + + goo + ``` -**hljs span spanning multiple lines** +**`no-line-numbers` attr should hide corresponding line numbers** -```markdown -***** ------ +```xml {.no-line-numbers} + + goo + ``` -**start-from attr causes inline style to be set** +**`start-from` attr should set inline css in `` tag, enabling lines to start from a specific line number** ```markdown {start-from=30} ***** ----- ``` -**highlight-lines attr causes corresponding lines to have 'highlighted' class** +**`highlight-lines` attr causes corresponding lines to have 'highlighted' class** ```markdown {highlight-lines="1,3,5-8"} 1 highlighted 2 @@ -49,7 +42,7 @@ function fourEmptyLinesBelow() { 10 ``` -**highlight-lines attr with start-from attr cause corresponding lines to have 'highlighted' class based on 'start-from'** +**`highlight-lines` attr with `start-from` attr should cause corresponding lines to have 'highlighted' class based on `start-from`** ```markdown {start-from=11 highlight-lines="11,13,15-18"} 11 highlighted 12 @@ -63,7 +56,7 @@ function fourEmptyLinesBelow() { 20 ``` -**Code block heading** +**Should render correctly with heading** ```{heading="A heading"} @@ -71,10 +64,56 @@ function fourEmptyLinesBelow() { ``` -**Code block heading with inline markdown** +**Inline markdown contained in heading should also be rendered correctly** ```{heading="**Bold**, _Italic_, ___Bold and Italic___, ~~Strike through~~, ****Super Bold****, ++Underline++, ==Highlight==, :+1: :exclamation: :x: :construction:
We support page breaks"} ``` + +**Code block with multiple linebreaks should not have the empty lines collapsed** + +``` + +Four empty lines below, one above + + + + +Four empty lines above, one below + +``` + +**Code block without line numbers and multiple linebreaks should not have the empty lines collapsed** + +```{.no-line-numbers} + +Four empty lines below, one above + + + + +Four empty lines above, one below + +``` + +**Code block with syntax highlighting and multiple linebreaks should not have the empty lines collapsed** + +```js + +function fourEmptyLinesBelowOneAbove() { + + + + +} // four empty lines above, one below + +``` + +**span with `hljs` class should span multiple lines [(Link for context)](https://github.com/MarkBind/markbind/pull/991#issuecomment-586547275)** + +```markdown +***** +----- +```