FIX: Indented code blocks followed by `<blockquote>` weren't working.
This commit is contained in:
parent
d867fb62e4
commit
e2c361f353
|
@ -25,12 +25,16 @@ var blockTags = ['address', 'article', 'aside', 'audio', 'blockquote', 'canvas',
|
||||||
};
|
};
|
||||||
|
|
||||||
Discourse.Dialect.registerBlock('html', function(block, next) {
|
Discourse.Dialect.registerBlock('html', function(block, next) {
|
||||||
|
var split;
|
||||||
|
|
||||||
// Fix manual blockquote paragraphing even though it's not strictly correct
|
// Fix manual blockquote paragraphing even though it's not strictly correct
|
||||||
var split = splitAtLast('blockquote', block, next, true);
|
if (block.search(/[^\s]+<blockquote/) === 0) {
|
||||||
if (split) { return split; }
|
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]) {
|
if (m && m[1]) {
|
||||||
var tag = m[1].split(/\s/);
|
var tag = m[1].split(/\s/);
|
||||||
if (tag && tag[0] && blockTags.indexOf(tag[0]) !== -1) {
|
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>",
|
"<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");
|
"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() {
|
test("sanitize", function() {
|
||||||
|
|
Loading…
Reference in New Issue