mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Normalize newline characters so Linux and Windows trim error context consistently.
This commit is contained in:
parent
cdfa934d8d
commit
4ecbf9d945
1 changed files with 3 additions and 3 deletions
|
@ -308,9 +308,9 @@ module.exports.addErrorDetailIf = addErrorDetailIf;
|
|||
* @param {RuleOnErrorFixInfo} [fixInfo] RuleOnErrorFixInfo instance.
|
||||
* @returns {void}
|
||||
*/
|
||||
function addErrorContext(
|
||||
onError, lineNumber, context, start, end, range, fixInfo) {
|
||||
context = ellipsify(context, start, end);
|
||||
function addErrorContext(onError, lineNumber, context, start, end, range, fixInfo) {
|
||||
// Normalize new line characters so Linux and Windows trim consistently
|
||||
context = ellipsify(context.replace(newLineRe, "\n"), start, end);
|
||||
addError(onError, lineNumber, undefined, context, range, fixInfo);
|
||||
}
|
||||
module.exports.addErrorContext = addErrorContext;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue