Reimplement MD049/emphasis-style, MD050/strong-style to use micromark parser (with smaller ranges and handling of multi-line fixes).

This commit is contained in:
David Anson 2023-05-25 03:47:34 +00:00
parent e1233aad4b
commit 7005a8a438
9 changed files with 1211 additions and 348 deletions

View file

@ -3,7 +3,7 @@
"use strict";
const { addErrorContext } = require("../helpers");
const { filterByTypes } = require("../helpers/micromark.cjs");
const { filterByTypes, tokenIfType } = require("../helpers/micromark.cjs");
const leftSpaceRe = /^\s(?:[^`]|$)/;
const rightSpaceRe = /[^`]\s$/;
@ -17,7 +17,6 @@ const trimCodeText = (text, start, end) => {
}
return text;
};
const tokenIfType = (token, type) => token && (token.type === type) && token;
module.exports = {
"names": [ "MD038", "no-space-in-code" ],