mirror of
https://github.com/discourse/discourse.git
synced 2025-06-20 18:41:33 +08:00
correct tests
This commit is contained in:
@ -340,10 +340,12 @@ test("Code Blocks", function() {
|
|||||||
"<p>hello<br/>world<br/></p>\n\n<p><pre><code class=\"json\">line 1\n\nline 2\n\n\nline3</code></pre></p>",
|
"<p>hello<br/>world<br/></p>\n\n<p><pre><code class=\"json\">line 1\n\nline 2\n\n\nline3</code></pre></p>",
|
||||||
"it maintains new lines inside a code block with leading content.");
|
"it maintains new lines inside a code block with leading content.");
|
||||||
|
|
||||||
cooked("```text\n<header>hello</header>\n```",
|
cooked("```ruby\n<header>hello</header>\n```",
|
||||||
"<p><pre><code class=\"text\"><header>hello</header></code></pre></p>",
|
"<p><pre><code class=\"ruby\"><header>hello</header></code></pre></p>",
|
||||||
"it escapes code in the code block");
|
"it escapes code in the code block");
|
||||||
|
|
||||||
|
cooked("```text\ntext\n```", "<p><pre><code>text</code></pre></p>", "handles text without adding class");
|
||||||
|
|
||||||
cooked("```ruby\n# cool\n```",
|
cooked("```ruby\n# cool\n```",
|
||||||
"<p><pre><code class=\"ruby\"># cool</code></pre></p>",
|
"<p><pre><code class=\"ruby\"># cool</code></pre></p>",
|
||||||
"it supports changing the language");
|
"it supports changing the language");
|
||||||
|
Reference in New Issue
Block a user