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

@ -3967,7 +3967,7 @@ module.exports = {
var linkText = "";
var lineIndex = 0;
children.forEach(function (child) {
var content = child.content, type = child.type;
var content = child.content, markup = child.markup, type = child.type;
if (type === "link_open") {
inLink = true;
linkText = "";
@ -4000,7 +4000,9 @@ module.exports = {
lineIndex = 0;
}
else if (inLink) {
linkText += content;
linkText += type.endsWith("_inline") ?
"".concat(markup).concat(content).concat(markup) :
(content || markup);
}
});
});