mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 08:44:40 +08:00
FIX: Quotes inside a list
This commit is contained in:
@ -25,18 +25,3 @@ replaceMarkdown('*', 'em');
|
||||
replaceMarkdown('_', 'em');
|
||||
|
||||
|
||||
// There's a weird issue with the markdown parser where it won't process simple blockquotes
|
||||
// when they are prefixed with spaces. This fixes it.
|
||||
Discourse.Dialect.on("register", function(event) {
|
||||
var dialect = event.dialect,
|
||||
MD = event.MD;
|
||||
|
||||
dialect.block["fix_simple_quotes"] = function(block, next) {
|
||||
var m = /^ +(\>[\s\S]*)/.exec(block);
|
||||
if (m && m[1] && m[1].length) {
|
||||
next.unshift(MD.mk_block(m[1]));
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
});
|
@ -0,0 +1,16 @@
|
||||
// There's a weird issue with the markdown parser where it won't process simple blockquotes
|
||||
// when they are prefixed with spaces. This fixes it.
|
||||
Discourse.Dialect.on("register", function(event) {
|
||||
var dialect = event.dialect,
|
||||
MD = event.MD;
|
||||
|
||||
dialect.block["fix_simple_quotes"] = function(block, next) {
|
||||
var m = /(^|\n) +(\>[\s\S]*)/.exec(block);
|
||||
if (m && m[2] && m[2].length) {
|
||||
var blockContents = block.replace(/(^|\n) +\>/, "$1>");
|
||||
next.unshift(blockContents);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
});
|
@ -691,7 +691,8 @@ Markdown.dialects.Gruber = {
|
||||
|
||||
var next_block = next[0] && next[0].valueOf() || "";
|
||||
|
||||
if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) {
|
||||
|
||||
if ( next_block.match(is_list_re) || (next_block.match(/^ /) && (!next_block.match(/^ *\>/))) ) {
|
||||
block = next.shift();
|
||||
|
||||
// Check for an HR following a list: features/lists/hr_abutting
|
||||
@ -711,6 +712,7 @@ Markdown.dialects.Gruber = {
|
||||
break;
|
||||
} // loose_search
|
||||
|
||||
|
||||
return ret;
|
||||
};
|
||||
})(),
|
||||
|
Reference in New Issue
Block a user