mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 12:48:54 +08:00
FIX: Markdown bug
This commit is contained in:
parent
981d8f6aea
commit
4a32cddf80
@ -50,6 +50,10 @@ test("Traditional Line Breaks", function() {
|
||||
cooked(input, traditionalOutput, "It supports traditional markdown via a Site Setting");
|
||||
});
|
||||
|
||||
test("Unbalanced underscores", function() {
|
||||
cooked("[evil_trout][1] hello_\n\n[1]: http://eviltrout.com", "<p><a href=\"http://eviltrout.com\">evil_trout</a> hello_</p>");
|
||||
});
|
||||
|
||||
test("Line Breaks", function() {
|
||||
cooked("[] first choice\n[] second choice",
|
||||
"<p>[] first choice<br/>[] second choice</p>",
|
||||
|
5
vendor/assets/javascripts/better_markdown.js
vendored
5
vendor/assets/javascripts/better_markdown.js
vendored
@ -643,7 +643,8 @@
|
||||
var DialectHelpers = {};
|
||||
DialectHelpers.inline_until_char = function( text, want ) {
|
||||
var consumed = 0,
|
||||
nodes = [];
|
||||
nodes = [],
|
||||
patterns = this.dialect.inline.__patterns__.replace('|_|', '');
|
||||
|
||||
while ( true ) {
|
||||
if ( text.charAt( consumed ) === want ) {
|
||||
@ -657,7 +658,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) );
|
||||
var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ), patterns );
|
||||
consumed += res[ 0 ];
|
||||
// Add any returned nodes.
|
||||
nodes.push.apply( nodes, res.slice( 1 ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user