Update applyFix to make line ending optional, MD047 to highlight only last character.

This commit is contained in:
David Anson 2019-09-20 21:50:44 -07:00
parent d974e78e3f
commit 4843e277c0
4 changed files with 52 additions and 4 deletions

View file

@ -457,7 +457,7 @@ function applyFix(line, fixInfo, lineEnding) {
return (deleteCount === -1) ?
null :
line.slice(0, editIndex) +
insertText.replace(/\n/g, lineEnding) +
insertText.replace(/\n/g, lineEnding || "\n") +
line.slice(editIndex + deleteCount);
}
module.exports.applyFix = applyFix;