mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Centralize handling of newlines in error detail/context to always replace (consecutive) newlines with a single space.
This commit is contained in:
parent
db967fd387
commit
cdfa934d8d
5 changed files with 21 additions and 45 deletions
|
|
@ -310,7 +310,7 @@ module.exports.addErrorDetailIf = addErrorDetailIf;
|
|||
*/
|
||||
function addErrorContext(
|
||||
onError, lineNumber, context, start, end, range, fixInfo) {
|
||||
context = ellipsify(context.replace(newLineRe, "\n"), start, end);
|
||||
context = ellipsify(context, start, end);
|
||||
addError(onError, lineNumber, undefined, context, range, fixInfo);
|
||||
}
|
||||
module.exports.addErrorContext = addErrorContext;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue