mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Blockquote issue
This commit is contained in:
parent
63d86eb9eb
commit
9e815dbef9
2 changed files with 7 additions and 16 deletions
|
@ -1,16 +0,0 @@
|
|||
// 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_block_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 [];
|
||||
}
|
||||
};
|
||||
|
||||
});
|
7
vendor/assets/javascripts/better_markdown.js
vendored
7
vendor/assets/javascripts/better_markdown.js
vendored
|
@ -719,6 +719,13 @@ Markdown.dialects.Gruber = {
|
|||
|
||||
blockquote: function blockquote( 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 [];
|
||||
}
|
||||
|
||||
if ( !block.match( /^>/m ) )
|
||||
return undefined;
|
||||
|
||||
|
|
Loading…
Reference in a new issue