mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FIX: You couldn't span multiple lines with bold or italics
This commit is contained in:
parent
b2f2e7b1d2
commit
423d37a2b6
@ -23,7 +23,7 @@ var replaceMarkdown = function(match, tag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var endText = new RegExp("[^\\s|" + match[0] + "]" + match.replace(/\*/g,"\\*") + "([^" + match[0] + "]|$)");
|
var endText = new RegExp("[^\\s|" + match[0] + "]" + match.replace(/\*/g,"\\*") + "([^" + match[0] + "]|$)");
|
||||||
var finish = text.split("\n")[0].search(endText);
|
var finish = text.search(endText);
|
||||||
if(finish && finish >= 0) {
|
if(finish && finish >= 0) {
|
||||||
var newText = text.substring(match.length,finish+1);
|
var newText = text.substring(match.length,finish+1);
|
||||||
newText = this.processInline(newText);
|
newText = this.processInline(newText);
|
||||||
|
@ -276,6 +276,10 @@ test("bold and italics", function() {
|
|||||||
cooked("**你hello**", "<p><strong>你hello</strong></p>", "allows bolded chinese");
|
cooked("**你hello**", "<p><strong>你hello</strong></p>", "allows bolded chinese");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("New Lines", function() {
|
||||||
|
cooked("_abc\ndef_", "<p><em>abc<br>def</em></p>", "it allows markup to span new lines");
|
||||||
|
});
|
||||||
|
|
||||||
test("Oneboxing", function() {
|
test("Oneboxing", function() {
|
||||||
|
|
||||||
var matches = function(input, regexp) {
|
var matches = function(input, regexp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user