mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Allow empty string for detail/context in onError callback from rules.
This commit is contained in:
parent
b3f0d76a67
commit
f80b61d8b7
3 changed files with 65 additions and 15 deletions
|
@ -326,16 +326,12 @@ function lintContent(
|
|||
!shared.isNumber(errorInfo.lineNumber)) {
|
||||
throwError("lineNumber");
|
||||
}
|
||||
if ((errorInfo.detail !== null) &&
|
||||
(errorInfo.detail !== undefined) &&
|
||||
(!shared.isString(errorInfo.detail) ||
|
||||
shared.isEmptyString(errorInfo.detail))) {
|
||||
if (errorInfo.detail &&
|
||||
!shared.isString(errorInfo.detail)) {
|
||||
throwError("detail");
|
||||
}
|
||||
if ((errorInfo.context !== null) &&
|
||||
(errorInfo.context !== undefined) &&
|
||||
(!shared.isString(errorInfo.context) ||
|
||||
shared.isEmptyString(errorInfo.context))) {
|
||||
if (errorInfo.context &&
|
||||
!shared.isString(errorInfo.context)) {
|
||||
throwError("context");
|
||||
}
|
||||
if (errorInfo.range &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue