mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Rename markdownlint-micromark Token's .tokens property to .children for consistency and clarity.
This commit is contained in:
parent
781b854f4b
commit
13ced64c21
6 changed files with 1558 additions and 1558 deletions
16
lib/md038.js
16
lib/md038.js
|
|
@ -27,17 +27,17 @@ module.exports = {
|
|||
const codeTextTokens =
|
||||
filterByTypes(params.parsers.micromark.tokens, [ "codeText" ]);
|
||||
for (const token of codeTextTokens) {
|
||||
const { tokens } = token;
|
||||
const { children } = token;
|
||||
const first = 0;
|
||||
const last = tokens.length - 1;
|
||||
const startSequence = tokenIfType(tokens[first], "codeTextSequence");
|
||||
const endSequence = tokenIfType(tokens[last], "codeTextSequence");
|
||||
const last = children.length - 1;
|
||||
const startSequence = tokenIfType(children[first], "codeTextSequence");
|
||||
const endSequence = tokenIfType(children[last], "codeTextSequence");
|
||||
const startData =
|
||||
tokenIfType(tokens[first + 1], "codeTextData") ||
|
||||
tokenIfType(tokens[first + 2], "codeTextData");
|
||||
tokenIfType(children[first + 1], "codeTextData") ||
|
||||
tokenIfType(children[first + 2], "codeTextData");
|
||||
const endData =
|
||||
tokenIfType(tokens[last - 1], "codeTextData") ||
|
||||
tokenIfType(tokens[last - 2], "codeTextData");
|
||||
tokenIfType(children[last - 1], "codeTextData") ||
|
||||
tokenIfType(children[last - 2], "codeTextData");
|
||||
if (startSequence && endSequence && startData && endData) {
|
||||
const spaceLeft = leftSpaceRe.test(startData.text);
|
||||
const spaceRight = !spaceLeft && rightSpaceRe.test(endData.text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue