Update MD039/no-space-in-links to not remove code/emphasis markers when fixing issues (fixes #482).

This commit is contained in:
David Anson 2022-05-06 21:42:31 -07:00
parent a8f946e0b3
commit 7bb80d19b1
6 changed files with 207 additions and 5 deletions

View file

@ -19,7 +19,7 @@ module.exports = {
let linkText = "";
let lineIndex = 0;
children.forEach((child) => {
const { content, type } = child;
const { content, markup, type } = child;
if (type === "link_open") {
inLink = true;
linkText = "";
@ -57,7 +57,9 @@ module.exports = {
lineNumber++;
lineIndex = 0;
} else if (inLink) {
linkText += content;
linkText += type.endsWith("_inline") ?
`${markup}${content}${markup}` :
(content || markup);
}
});
});