mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
FIX: fix dialect block ordering
This commit is contained in:
parent
c80ef9e3fa
commit
30dbb570e5
@ -21,6 +21,11 @@ var parser = window.BetterMarkdown,
|
||||
**/
|
||||
function initializeDialects() {
|
||||
MD.buildBlockOrder(dialect.block);
|
||||
var index = dialect.block.__order__.indexOf("code");
|
||||
if (index > -1) {
|
||||
dialect.block.__order__.splice(index, 1);
|
||||
dialect.block.__order__.unshift("code");
|
||||
}
|
||||
MD.buildInlinePatterns(dialect.inline);
|
||||
initialized = true;
|
||||
}
|
||||
|
@ -379,6 +379,14 @@ test("Code Blocks", function() {
|
||||
cooked("```\nline1\n```\n```\nline2\n\nline3\n```",
|
||||
"<p><pre><code class=\"lang-auto\">line1</code></pre></p>\n\n<p><pre><code class=\"lang-auto\">line2\n\nline3</code></pre></p>",
|
||||
"it does not consume next block's trailing newlines");
|
||||
|
||||
cooked(" <pre>test</pre>",
|
||||
"<pre><code><pre>test</pre></code></pre>",
|
||||
"it does not parse other block types in markdown code blocks");
|
||||
|
||||
cooked(" [quote]test[/quote]",
|
||||
"<pre><code>[quote]test[/quote]</code></pre>",
|
||||
"it does not parse other block types in markdown code blocks");
|
||||
});
|
||||
|
||||
test("sanitize", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user