Reimplement MD027/no-multiple-space-blockquote using micromark tokens.

This commit is contained in:
David Anson 2024-02-25 15:06:28 -08:00
parent a2997f1595
commit 730ae9a96f
11 changed files with 248 additions and 167 deletions

View file

@ -3,14 +3,14 @@
"use strict";
const { addError } = require("../helpers");
const { getSiblingLists } = require("../helpers/micromark.cjs");
const { getSiblingTokens } = require("../helpers/micromark.cjs");
module.exports = {
"names": [ "MD028", "no-blanks-blockquote" ],
"description": "Blank line inside blockquote",
"tags": [ "blockquote", "whitespace" ],
"function": function MD028(params, onError) {
for (const siblings of getSiblingLists(params.parsers.micromark.tokens)) {
for (const siblings of getSiblingTokens(params.parsers.micromark.tokens)) {
let errorLineNumbers = null;
for (const sibling of siblings) {
switch (sibling.type) {