FIX: Indented code blocks followed by `<blockquote>` weren't working.
This commit is contained in:
parent
d867fb62e4
commit
e2c361f353
|
@ -20,4 +20,4 @@ Discourse.Dialect.registerInline('"', function(str, match, prev) {
|
|||
return [str.length, ['blockquote', inner]];
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -25,12 +25,16 @@ var blockTags = ['address', 'article', 'aside', 'audio', 'blockquote', 'canvas',
|
|||
};
|
||||
|
||||
Discourse.Dialect.registerBlock('html', function(block, next) {
|
||||
var split;
|
||||
|
||||
// Fix manual blockquote paragraphing even though it's not strictly correct
|
||||
var split = splitAtLast('blockquote', block, next, true);
|
||||
if (split) { return split; }
|
||||
if (block.search(/[^\s]+<blockquote/) === 0) {
|
||||
console.log(/[^\s]+<blockquote/.exec(block));
|
||||
split = splitAtLast('blockquote', block, next, true);
|
||||
if (split) { return this.processInline(split[0]); }
|
||||
}
|
||||
|
||||
var m = /^<([^>]+)\>/m.exec(block);
|
||||
var m = /^<([^>]+)\>/.exec(block);
|
||||
if (m && m[1]) {
|
||||
var tag = m[1].split(/\s/);
|
||||
if (tag && tag[0] && blockTags.indexOf(tag[0]) !== -1) {
|
||||
|
|
|
@ -321,6 +321,9 @@ test("Code Blocks", function() {
|
|||
"<p><pre><code class=\"lang-auto\">[quote="sam, post:1, topic:9441, full:true"]This is `<not>` a bug.[/quote]</code></pre></p>",
|
||||
"it allows code with backticks in it");
|
||||
|
||||
cooked(" hello\n<blockquote>test</blockquote>",
|
||||
"<pre><code>hello</code></pre>\n\n<blockquote>test</blockquote>",
|
||||
"it allows an indented code block to by followed by a `<blockquote>`");
|
||||
});
|
||||
|
||||
test("sanitize", function() {
|
||||
|
|
Loading…
Reference in New Issue