mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Fix highlighting of MD011/no-reversed-links when preceeded by decorated text.
This commit is contained in:
parent
a5f03d02d0
commit
3632ce28b9
4 changed files with 15 additions and 1 deletions
|
|
@ -16,7 +16,8 @@ module.exports = {
|
||||||
let match = null;
|
let match = null;
|
||||||
while ((match = reversedLinkRe.exec(content)) !== null) {
|
while ((match = reversedLinkRe.exec(content)) !== null) {
|
||||||
const [ reversedLink, linkText, linkDestination ] = match;
|
const [ reversedLink, linkText, linkDestination ] = match;
|
||||||
const column = match.index + 1;
|
const line = params.lines[lineNumber - 1];
|
||||||
|
const column = line.indexOf(reversedLink) + 1;
|
||||||
const length = reversedLink.length;
|
const length = reversedLink.length;
|
||||||
addError(
|
addError(
|
||||||
onError,
|
onError,
|
||||||
|
|
|
||||||
|
|
@ -22,3 +22,5 @@ A (reversed)[link] example.
|
||||||
## Multiple spaces E ##
|
## Multiple spaces E ##
|
||||||
|
|
||||||
## Multiple spaces F ##
|
## Multiple spaces F ##
|
||||||
|
|
||||||
|
*Another* (reversed)[link] example.
|
||||||
|
|
|
||||||
|
|
@ -21,3 +21,5 @@ A [reversed](link) example.
|
||||||
## Multiple spaces E ##
|
## Multiple spaces E ##
|
||||||
|
|
||||||
## Multiple spaces F ##
|
## Multiple spaces F ##
|
||||||
|
|
||||||
|
*Another* [reversed](link) example.
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,15 @@
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": [3, 16]
|
"errorRange": [3, 16]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"lineNumber": 26,
|
||||||
|
"ruleNames": [ "MD011", "no-reversed-links" ],
|
||||||
|
"ruleDescription": "Reversed link syntax",
|
||||||
|
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md011",
|
||||||
|
"errorDetail": "(reversed)[link]",
|
||||||
|
"errorContext": null,
|
||||||
|
"errorRange": [11, 16]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"lineNumber": 7,
|
"lineNumber": 7,
|
||||||
"ruleNames": [ "MD012", "no-multiple-blanks" ],
|
"ruleNames": [ "MD012", "no-multiple-blanks" ],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue