mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:56:18 +08:00
A couple of important markdown fixes.
This commit is contained in:
parent
f611a5d898
commit
f7ad80ff7b
|
@ -20,6 +20,7 @@ var replaceMarkdown = function(match, tag) {
|
|||
};
|
||||
|
||||
replaceMarkdown('**', 'strong');
|
||||
replaceMarkdown('__', 'strong');
|
||||
replaceMarkdown('*', 'em');
|
||||
replaceMarkdown('_', 'em');
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ Discourse.Dialect = {
|
|||
|
||||
var contents = args.emitter.call(this, between);
|
||||
if (contents) {
|
||||
return [endPos + startLength + 1, contents];
|
||||
return [endPos+stop.length, contents];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -18,12 +18,14 @@ var cookedOptions = function(input, opts, expected, text) {
|
|||
test("basic cooking", function() {
|
||||
cooked("hello", "<p>hello</p>", "surrounds text with paragraphs");
|
||||
cooked("**evil**", "<p><strong>evil</strong></p>", "it bolds text.");
|
||||
cooked("__bold__", "<p><strong>bold</strong></p>", "it bolds text.");
|
||||
cooked("*trout*", "<p><em>trout</em></p>", "it italicizes text.");
|
||||
cooked("_trout_", "<p><em>trout</em></p>", "it italicizes text.");
|
||||
cooked("***hello***", "<p><strong><em>hello</em></strong></p>", "it can do bold and italics at once.");
|
||||
cooked("word_with_underscores", "<p>word_with_underscores</p>", "it doesn't do intraword italics");
|
||||
cooked("hello \\*evil\\*", "<p>hello *evil*</p>", "it supports escaping of asterisks");
|
||||
cooked("hello \\_evil\\_", "<p>hello _evil_</p>", "it supports escaping of italics");
|
||||
cooked("brussel sproutes are *awful*.", "<p>brussel sproutes are <em>awful</em>.</p>", "it doesn't swallow periods.");
|
||||
});
|
||||
|
||||
test("Traditional Line Breaks", function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user