mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update MD051/link-fragments to not provide error context for multi-line scenarios.
This commit is contained in:
parent
ef1bd286a9
commit
1eb40d3c4c
4 changed files with 12 additions and 8 deletions
|
@ -6202,11 +6202,14 @@ module.exports = {
|
|||
var _loop = function _loop() {
|
||||
var definition = _step4.value;
|
||||
if (definition.text.length > 1 && definition.text.startsWith("#") && !fragments.has(definition.text)) {
|
||||
// eslint-disable-next-line no-undef-init
|
||||
var context = undefined;
|
||||
// eslint-disable-next-line no-undef-init
|
||||
var range = undefined;
|
||||
// eslint-disable-next-line no-undef-init
|
||||
var fixInfo = undefined;
|
||||
if (link.startLine === link.endLine) {
|
||||
context = link.text;
|
||||
range = [link.startColumn, link.endColumn - link.startColumn];
|
||||
fixInfo = {
|
||||
"editColumn": definition.startColumn,
|
||||
|
@ -6220,9 +6223,9 @@ module.exports = {
|
|||
if (mixedCaseKey) {
|
||||
// @ts-ignore
|
||||
(fixInfo || {}).insertText = mixedCaseKey;
|
||||
addErrorDetailIf(onError, link.startLine, mixedCaseKey, definition.text, undefined, link.text, range, fixInfo);
|
||||
addErrorDetailIf(onError, link.startLine, mixedCaseKey, definition.text, undefined, context, range, fixInfo);
|
||||
} else {
|
||||
addError(onError, link.startLine, undefined, link.text, range);
|
||||
addError(onError, link.startLine, undefined, context, range);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue