mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD039/no-space-in-links to not remove code/emphasis markers when fixing issues (fixes #482).
This commit is contained in:
parent
a8f946e0b3
commit
7bb80d19b1
6 changed files with 207 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue