mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Update MD037/no-space-in-emphasis to provide same range as fixInfo for consistency with other "no-space-in-" rules.
This commit is contained in:
parent
371a35f62f
commit
2c97373fb5
4 changed files with 373 additions and 370 deletions
|
|
@ -50,15 +50,17 @@ export default {
|
|||
if (startMatch) {
|
||||
const [ startSpaceCharacter ] = startMatch;
|
||||
const startContext = `${marker}${startSpaceCharacter}`;
|
||||
const column = startToken.endColumn;
|
||||
const count = startSpaceCharacter.length - 1;
|
||||
addError(
|
||||
onError,
|
||||
startToken.startLine,
|
||||
undefined,
|
||||
startContext,
|
||||
[ startToken.startColumn, startContext.length ],
|
||||
[ column, count ],
|
||||
{
|
||||
"editColumn": startToken.endColumn,
|
||||
"deleteCount": startSpaceCharacter.length - 1
|
||||
"editColumn": column,
|
||||
"deleteCount": count
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -71,16 +73,17 @@ export default {
|
|||
if (endMatch) {
|
||||
const [ endSpaceCharacter ] = endMatch;
|
||||
const endContext = `${endSpaceCharacter}${marker}`;
|
||||
const column = endToken.startColumn - (endSpaceCharacter.length - 1);
|
||||
const count = endSpaceCharacter.length - 1;
|
||||
addError(
|
||||
onError,
|
||||
endToken.startLine,
|
||||
undefined,
|
||||
endContext,
|
||||
[ endToken.endColumn - endContext.length, endContext.length ],
|
||||
[ column, count ],
|
||||
{
|
||||
"editColumn":
|
||||
endToken.startColumn - (endSpaceCharacter.length - 1),
|
||||
"deleteCount": endSpaceCharacter.length - 1
|
||||
"editColumn": column,
|
||||
"deleteCount": count
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ test("resultFormattingV3", (t) => new Promise((resolve) => {
|
|||
"ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`,
|
||||
"errorDetail": null,
|
||||
"errorContext": "* e",
|
||||
"errorRange": [ 6, 3 ],
|
||||
"errorRange": [ 7, 1 ],
|
||||
"fixInfo": {
|
||||
"editColumn": 7,
|
||||
"deleteCount": 1
|
||||
|
|
@ -418,7 +418,7 @@ test("resultFormattingV3", (t) => new Promise((resolve) => {
|
|||
"ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`,
|
||||
"errorDetail": null,
|
||||
"errorContext": "s *",
|
||||
"errorRange": [ 15, 3 ],
|
||||
"errorRange": [ 16, 1 ],
|
||||
"fixInfo": {
|
||||
"editColumn": 16,
|
||||
"deleteCount": 1
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue