mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Fix MD007/ul-indent to use parent indent instead of previous indent (fixes #106).
This commit is contained in:
parent
748c8cac17
commit
40ace5bb5e
6 changed files with 58 additions and 15 deletions
|
@ -99,10 +99,11 @@ module.exports.escapeForRegExp = function escapeForRegExp(str) {
|
|||
};
|
||||
|
||||
// Returns the indent for a token
|
||||
module.exports.indentFor = function indentFor(token) {
|
||||
function indentFor(token) {
|
||||
var line = token.line.replace(/^[\s>]*(> |>)/, "");
|
||||
return line.length - trimLeft(line).length;
|
||||
};
|
||||
}
|
||||
module.exports.indentFor = indentFor;
|
||||
|
||||
// Returns the heading style for a heading token
|
||||
module.exports.headingStyleFor = function headingStyleFor(token) {
|
||||
|
@ -180,6 +181,8 @@ function makeTokenCache(params) {
|
|||
"parentsUnordered": !current ||
|
||||
(current.unordered && current.parentsUnordered),
|
||||
"open": token,
|
||||
"indent": indentFor(token),
|
||||
"parentIndent": (current && current.indent) || 0,
|
||||
"items": [],
|
||||
"nesting": stack.length - 1,
|
||||
"lastLineIndex": -1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue