mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:11:38 +08:00
FIX: Quotes with text against them had the wrong spacing
This commit is contained in:
parent
41729aab14
commit
4331bba549
|
@ -102,6 +102,11 @@ Discourse.Markdown = {
|
|||
var quoteTemplate = null, urlsTemplate = null;
|
||||
|
||||
// Before cooking callbacks
|
||||
converter.hooks.chain("preConversion", function(text) {
|
||||
// If a user puts text right up against a quote, make sure the spacing is equivalnt to a new line
|
||||
return text.replace(/\[\/quote\]/, "[/quote]\n");
|
||||
});
|
||||
|
||||
converter.hooks.chain("preConversion", function(text) {
|
||||
Discourse.Markdown.trigger('beforeCook', { detail: text, opts: opts });
|
||||
return Discourse.Markdown.textResult || text;
|
||||
|
|
|
@ -69,13 +69,13 @@ test("Quotes", function() {
|
|||
cookedOptions("1[quote=\"bob, post:1\"]my quote[/quote]2",
|
||||
{ topicId: 2, lookupAvatar: function(name) { return "" + name; } },
|
||||
"<p>1</p><aside class='quote' data-post=\"1\" >\n <div class='title'>\n <div class='quote-controls'></div>\n" +
|
||||
" bob\n bob\n said:\n </div>\n <blockquote>my quote</blockquote>\n</aside>\n<p> <br>\n2</p>",
|
||||
" bob\n bob\n said:\n </div>\n <blockquote>my quote</blockquote>\n</aside>\n<p></p>\n\n<p>2</p>",
|
||||
"handles quotes properly");
|
||||
|
||||
cookedOptions("1[quote=\"bob, post:1\"]my quote[/quote]2",
|
||||
{ topicId: 2, lookupAvatar: function(name) { } },
|
||||
"<p>1</p><aside class='quote' data-post=\"1\" >\n <div class='title'>\n <div class='quote-controls'></div>\n" +
|
||||
" \n bob\n said:\n </div>\n <blockquote>my quote</blockquote>\n</aside>\n<p> <br>\n2</p>",
|
||||
" \n bob\n said:\n </div>\n <blockquote>my quote</blockquote>\n</aside>\n<p></p>\n\n<p>2</p>",
|
||||
"includes no avatar if none is found");
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user