Centralize handling of newlines in error detail/context to always replace (consecutive) newlines with a single space.

This commit is contained in:
David Anson 2025-05-04 23:18:51 -07:00
parent db967fd387
commit cdfa934d8d
5 changed files with 21 additions and 45 deletions

View file

@ -627,8 +627,8 @@ function lintContent(
"ruleNames": rule.names,
"ruleDescription": rule.description,
"ruleInformation": information ? information.href : null,
"errorDetail": errorInfo.detail || null,
"errorContext": errorInfo.context || null,
"errorDetail": errorInfo.detail?.replace(helpers.newLineRe, " ") || null,
"errorContext": errorInfo.context?.replace(helpers.newLineRe, " ") || null,
"errorRange": errorInfo.range ? [ ...errorInfo.range ] : null,
"fixInfo": fixInfo ? cleanFixInfo : null
});