Changed markdown lexer to ignore lists containing only one item
Этот коммит содержится в:
@@ -289,19 +289,22 @@ class MattermostLexer extends marked.Lexer {
|
||||
// list
|
||||
cap = this.rules.list.exec(src);
|
||||
if (cap) {
|
||||
src = src.substring(cap[0].length);
|
||||
const bull = cap[2];
|
||||
let l = cap[0].length;
|
||||
|
||||
// Get each top-level item.
|
||||
cap = cap[0].match(this.rules.item);
|
||||
|
||||
if (cap.length > 1) {
|
||||
src = src.substring(l);
|
||||
|
||||
this.tokens.push({
|
||||
type: 'list_start',
|
||||
ordered: bull.length > 1
|
||||
});
|
||||
|
||||
// Get each top-level item.
|
||||
cap = cap[0].match(this.rules.item);
|
||||
|
||||
let next = false;
|
||||
const l = cap.length;
|
||||
l = cap.length;
|
||||
|
||||
for (let i = 0; i < l; i++) {
|
||||
let item = cap[i];
|
||||
@@ -358,6 +361,7 @@ class MattermostLexer extends marked.Lexer {
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// html
|
||||
cap = this.rules.html.exec(src);
|
||||
|
||||
Ссылка в новой задаче
Block a user