mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10: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) {
|
if (startMatch) {
|
||||||
const [ startSpaceCharacter ] = startMatch;
|
const [ startSpaceCharacter ] = startMatch;
|
||||||
const startContext = `${marker}${startSpaceCharacter}`;
|
const startContext = `${marker}${startSpaceCharacter}`;
|
||||||
|
const column = startToken.endColumn;
|
||||||
|
const count = startSpaceCharacter.length - 1;
|
||||||
addError(
|
addError(
|
||||||
onError,
|
onError,
|
||||||
startToken.startLine,
|
startToken.startLine,
|
||||||
undefined,
|
undefined,
|
||||||
startContext,
|
startContext,
|
||||||
[ startToken.startColumn, startContext.length ],
|
[ column, count ],
|
||||||
{
|
{
|
||||||
"editColumn": startToken.endColumn,
|
"editColumn": column,
|
||||||
"deleteCount": startSpaceCharacter.length - 1
|
"deleteCount": count
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -71,16 +73,17 @@ export default {
|
||||||
if (endMatch) {
|
if (endMatch) {
|
||||||
const [ endSpaceCharacter ] = endMatch;
|
const [ endSpaceCharacter ] = endMatch;
|
||||||
const endContext = `${endSpaceCharacter}${marker}`;
|
const endContext = `${endSpaceCharacter}${marker}`;
|
||||||
|
const column = endToken.startColumn - (endSpaceCharacter.length - 1);
|
||||||
|
const count = endSpaceCharacter.length - 1;
|
||||||
addError(
|
addError(
|
||||||
onError,
|
onError,
|
||||||
endToken.startLine,
|
endToken.startLine,
|
||||||
undefined,
|
undefined,
|
||||||
endContext,
|
endContext,
|
||||||
[ endToken.endColumn - endContext.length, endContext.length ],
|
[ column, count ],
|
||||||
{
|
{
|
||||||
"editColumn":
|
"editColumn": column,
|
||||||
endToken.startColumn - (endSpaceCharacter.length - 1),
|
"deleteCount": count
|
||||||
"deleteCount": endSpaceCharacter.length - 1
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ test("resultFormattingV3", (t) => new Promise((resolve) => {
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`,
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`,
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "* e",
|
"errorContext": "* e",
|
||||||
"errorRange": [ 6, 3 ],
|
"errorRange": [ 7, 1 ],
|
||||||
"fixInfo": {
|
"fixInfo": {
|
||||||
"editColumn": 7,
|
"editColumn": 7,
|
||||||
"deleteCount": 1
|
"deleteCount": 1
|
||||||
|
|
@ -418,7 +418,7 @@ test("resultFormattingV3", (t) => new Promise((resolve) => {
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`,
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md037.md`,
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "s *",
|
"errorContext": "s *",
|
||||||
"errorRange": [ 15, 3 ],
|
"errorRange": [ 16, 1 ],
|
||||||
"fixInfo": {
|
"fixInfo": {
|
||||||
"editColumn": 16,
|
"editColumn": 16,
|
||||||
"deleteCount": 1
|
"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